001package gudusoft.gsqlparser; 002 003/** 004* <br>scalar expression: return a single value. 005 * <br>primary expressions: are the building blocks of more complex expressions. 006 * they are literals, column reference, function call, parenthesis expr, scalar subquery, 007 * case expr and etc. 008 * <br>binary expression: has two scalar expression. 009 * <br>unary expression: has one scalar expression. 010 * <br>boolean expression: evaluates to a value of the Boolean Data Type: True or False. 011 * 012 * <br><br> 013 * SQL Server 014 * <br><br>binary expression type: 015 * {@link #arithmetic_plus_t add},{@link #arithmetic_minus_t subtract},{@link #arithmetic_times_t multiply}, 016 * {@link #arithmetic_divide_t divide},{@link #arithmetic_modulo_t modulo}, 017 * {@link #bitwise_and_t bitwise and},{@link #bitwise_or_t bitwise or} 018 * ,{@link #bitwise_xor_t bitwise xor} 019 * 020 * <br><br>boolean expression: 021 * <br>{@link #exists_t exists predicate},{@link #pattern_matching_t like predicate}, 022 * {@link #in_t in predicate},{#link #pattern_matching_t full text predicate} 023 * 024 *<br><br>boolean comparison type: 025 * {@link #boolean_comparison_equal_t equals},{@link #boolean_comparison_greaterThan_t greater than}, 026 * {@link #boolean_comparison_lessThan_t less than}, 027 * {@link #boolean_comparison_greaterThanOrEqualTo_t greater than or equal to}, 028 * {@link #boolean_comparison_lessThanOrEqualTo_t less than or equal to}, 029 * {@link #boolean_comparison_notEqualToBrackets_t not equal to (<>)}, 030 * {@link #boolean_comparison_notEqualToExclamation_t not equla to (!=)}, 031 * {@link #boolean_comparison_notLessThan_t not less than}, 032 * {@link #boolean_comparison_notGreaterThan_t not greater than}, 033 * {@link #boolean_comparison_leftOuterJoin_t left outer join}, 034 * {@link #boolean_comparison_rightOuterJoin_t right outer join}, 035 * 036 * 037*/ 038public enum EExpressionType { 039 /** 040 * expression type not set yet. 041 */ 042 not_initialized_yet_t, 043 unknown_t, 044 removed_t, 045 simple_source_token_t, 046 simple_object_name_t, 047 simple_constant_t, 048 arithmetic_t, 049 arithmetic_plus_t, 050 arithmetic_minus_t, 051 arithmetic_times_t, 052 arithmetic_divide_t, // / 053 arithmetic_modulo_t, 054 arithmetic_compound_operator_t, 055 arithmetic_exponentiation_t, 056 parenthesis_t, 057 concatenate_t, 058 assignment_t, 059 list_t, 060 bitwise_t, 061 bitwise_and_t, 062 bitwise_or_t, 063 bitwise_xor_t, 064 bitwise_exclusive_or_t, 065 bitwise_shift_left_t, 066 bitwise_shift_right_t, 067 scope_resolution_t, 068 exponentiate_t, 069 simple_comparison_t, 070 071 boolean_comparison_equal_t, 072 boolean_comparison_greaterThan_t, 073 boolean_comparison_lessThan_t, 074 boolean_comparison_greaterThanOrEqualTo_t, 075 boolean_comparison_lessThanOrEqualTo_t, 076 boolean_comparison_notEqualToBrackets_t, 077 boolean_comparison_notEqualToExclamation_t, 078 boolean_comparison_notLessThan_t, 079 boolean_comparison_notGreaterThan_t, 080 boolean_comparison_leftOuterJoin_t, 081 boolean_comparison_rightOuterJoin_t, 082 083 group_comparison_t, 084 logical_t, 085 unary_t, 086 unary_plus_t, 087 unary_minus_t, 088 unary_prior_t, 089 unary_connect_by_root_t, //snowflake 090 unary_factorial_t, 091 unary_squareroot_t, 092 unary_cuberoot_t, 093 unary_factorialprefix_t, 094 unary_absolutevalue_t, 095 unary_bitwise_not_t, 096 unary_left_unknown_t, 097 unary_right_unknown_t, 098 unary_binary_operator_t, 099 /** 100 * Oracle 26c: OLD qualifier in RETURNING clause 101 * Represents syntax like: RETURNING OLD column_name 102 */ 103 unary_old_t, 104 /** 105 * Oracle 26c: NEW qualifier in RETURNING clause 106 * Represents syntax like: RETURNING NEW column_name 107 */ 108 unary_new_t, 109 case_t, 110 function_t, 111 cursor_t, 112 cursor_attribute_t, // SQL%NOTFOUND / cur%ROWCOUNT 113 subquery_t, 114 null_t, 115 is_not_null_t, 116 between_t, 117 exists_t, 118 pattern_matching_t,//like 119 place_holder_t, 120 floating_point_t, 121 logical_and_t, 122 logical_or_t, 123 logical_xor_t, 124 logical_not_t, 125 is_t, 126 in_t, 127 /** 128 * @deprecated As of v1.4.3.3, right operand of IN condition can be represented by {@link gudusoft.gsqlparser.nodes.TExpression} 129 */ 130 group_t,// this expression including a TInExpr 131 is_of_type_t, 132 range_t, 133 power_t, 134 at_time_zone_t, // at time zone expr 135 136 teradata_at_t,// expression AT time_zone_specification, 137 // -- With a direct column 138 // timestamp_column AT 'timezone_name' 139 // 140 // -- With a CAST function 141 // CAST(column_name AS TIMESTAMP(n)) AT 'timezone_name' 142 // 143 // -- With an expression 144 // (timestamp_column + INTERVAL '1' DAY) AT 'timezone_name' 145 146 at_local_t, 147 day_to_second_t, 148 year_to_month_t, 149 new_structured_type_t, 150 new_variant_type_t, 151 period_ldiff_t, 152 period_rdiff_t, 153 period_p_intersect_t, 154 period_p_normalize_t, 155 until_changed_t, 156 is_document_t, 157 is_distinct_from_t, 158 is_unknown_t, 159 is_false_t, 160 is_true_t, 161 is_not_false_t, 162 is_not_true_t, 163 collate_t, 164 left_join_t, 165 right_join_t, 166 ref_arrow_t, 167 arrayaccess_t, 168 array_t,//bigquery, this is refer to array constant 169 array_constructor_t, 170 array_access_expr_t,//sparksql,hive, expr[expr] 171 object_access_t, 172 sqlserver_proprietary_column_alias_t, 173 left_shift_t, 174 right_shift_t, 175 multiset_t, 176 fieldselection_t, 177 row_constructor_t, 178 member_of_t, 179 next_value_for_t, 180 datetime_t, 181 interval_t, 182 model_t, 183 type_constructor_t, 184 xml_t, 185 units_t,//informix 186 collection_constructor_set_t, 187 collection_constructor_multiset_t, 188 collection_constructor_list_t, 189 multiset_union_t,//oracle 190 multiset_union_distinct_t,//oracle 191 multiset_union_all_t,//oracle 192 multiset_intersect_t,//oracle 193 multiset_intersect_all_t,//oracle 194 multiset_intersect_distinct_t,//oracle 195 multiset_except_t,//oracle 196 multiset_except_distinct_t,//oracle 197 multiset_except_all_t,//oracle 198 field_access_t,//hive, expr.identifier.identifier 199 hive_variable_t, //hive variable 200 json_get_text, // ->> 201 json_get_text_at_path, // #>> 202 json_get_object, //postgresql, -> 203 json_get_object_at_path, // #> 204 json_left_contain, // @> 205 json_right_contain, //>@ 206 json_exist, // ? 207 json_any_exist, // ?! 208 json_all_exist, // ?& 209 json_delete_path,// #- 210 json_path_exists,// @? 211 json_path_match,// @@ 212 contains_t,//teradata contains 213 xml_method_t, // sql server .query(), .value(), .exist(), .modify(), .nodes() 214 interpolate_previous_value_t, //vertical 215 field_t,//couchbase 216 element_t,//couchbase 217 slice_t,//couchbase 218 cover_t,//couchbase 219 objectConstruct_t, //couchbase 220 namedParameter_t,//couchbase, 221 positionalParameter_t,//couchbase 222 collectionCondition_t,//couchbase 223 collectionArray_t,//couchbase 224 submultiset_t,//oracle 225 overlaps_t,//netezza 226 is_a_set_t,//oracle 227 unnest_t,//bigexpr 228 field_doubt_t, 229 lambda_t,//presto 230 column_definition_list_t, // postgres 231 execute_stmt_t,//snowflake, res := (execute immediate :select_statement); 232 call_stmt_t,//snowflake, res := (call procedure_name(args)); 233 geo_t,//postgresql 234 network_t, //postgresql 235 text_search_t,//postgresql 236 json_access_t,//databricks 237 json_path_t,//databricks 238 typecast_t, // in syntax like: expr typecast datatype, expr typecast datatype 239 typecast_datatype_t,//databricks,postgresql,gaussdb,greenplum in syntax like: datatype(expr), bigint(expr) 240 implicit_datatype_cast_as_t,// in syntax like: expr as datatype 241 /** 242 * Oracle syntax for parenthesized expression with property access 243 * Represents syntax like: (relation_module.get_first_parent('APP', app.appid)).id 244 */ 245 parenthesized_property_access_t, 246 /** 247 * Oracle 26c iterator choice in qualified expression 248 * Represents syntax like: FOR i IN 1..5 => i*10 249 */ 250 for_iterator_choice_t, 251} 252