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 (&lt;&gt;)},
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    case_t,
100    function_t,
101    cursor_t,
102    cursor_attribute_t, // SQL%NOTFOUND / cur%ROWCOUNT
103    subquery_t,
104    null_t,
105    is_not_null_t,
106    between_t,
107    exists_t,
108    pattern_matching_t,//like
109    place_holder_t,
110    floating_point_t,
111    logical_and_t,
112    logical_or_t,
113    logical_xor_t,
114    logical_not_t,
115    is_t,
116    in_t,
117    /**
118     * @deprecated As of v1.4.3.3, right operand of IN condition can be represented by {@link gudusoft.gsqlparser.nodes.TExpression}
119     */
120    group_t,// this expression including a TInExpr
121    is_of_type_t,
122    range_t,
123    power_t,
124    at_time_zone_t, // at time zone expr
125
126    teradata_at_t,// expression AT time_zone_specification,
127    //    -- With a direct column
128    //    timestamp_column AT 'timezone_name'
129    //
130    //            -- With a CAST function
131    //    CAST(column_name AS TIMESTAMP(n)) AT 'timezone_name'
132    //
133    //            -- With an expression
134    //            (timestamp_column + INTERVAL '1' DAY) AT 'timezone_name'
135
136    at_local_t,
137    day_to_second_t,
138    year_to_month_t,
139    new_structured_type_t,
140    new_variant_type_t,
141    period_ldiff_t,
142    period_rdiff_t,
143    period_p_intersect_t,
144    period_p_normalize_t,
145    until_changed_t,
146    is_document_t,
147    is_distinct_from_t,
148    is_unknown_t,
149    is_false_t,
150    is_true_t,
151    is_not_false_t,
152    is_not_true_t,
153    collate_t,
154    left_join_t,
155    right_join_t,
156    ref_arrow_t,
157    arrayaccess_t,
158    array_t,//bigquery, this is refer to array constant
159    array_constructor_t,
160    array_access_expr_t,//sparksql,hive, expr[expr]
161    object_access_t,
162    sqlserver_proprietary_column_alias_t,
163    left_shift_t,
164    right_shift_t,
165    multiset_t,
166    fieldselection_t,
167    row_constructor_t,
168    member_of_t,
169    next_value_for_t,
170    datetime_t,
171    interval_t,
172    model_t,
173    type_constructor_t,
174    xml_t,
175    units_t,//informix
176    collection_constructor_set_t,
177    collection_constructor_multiset_t,
178    collection_constructor_list_t,
179    multiset_union_t,//oracle
180    multiset_union_distinct_t,//oracle
181    multiset_union_all_t,//oracle
182    multiset_intersect_t,//oracle
183    multiset_intersect_all_t,//oracle
184    multiset_intersect_distinct_t,//oracle
185    multiset_except_t,//oracle
186    multiset_except_distinct_t,//oracle
187    multiset_except_all_t,//oracle
188    field_access_t,//hive, expr.identifier.identifier
189    hive_variable_t, //hive variable
190    json_get_text, // ->>
191    json_get_text_at_path, // #>>
192    json_get_object, //postgresql, ->
193    json_get_object_at_path, // #>
194    json_left_contain, // @>
195    json_right_contain, //>@
196    json_exist, // ?
197    json_any_exist, // ?!
198    json_all_exist, // ?&
199    json_delete_path,// #-
200    json_path_exists,// @?
201    json_path_match,// @@
202    contains_t,//teradata contains
203    xml_method_t, // sql server .query(), .value(), .exist(), .modify(), .nodes()
204    interpolate_previous_value_t, //vertical
205    field_t,//couchbase
206    element_t,//couchbase
207    slice_t,//couchbase
208    cover_t,//couchbase
209    objectConstruct_t, //couchbase
210    namedParameter_t,//couchbase,
211    positionalParameter_t,//couchbase
212    collectionCondition_t,//couchbase
213    collectionArray_t,//couchbase
214    submultiset_t,//oracle
215    overlaps_t,//netezza
216    is_a_set_t,//oracle
217    unnest_t,//bigexpr
218    field_doubt_t,
219    lambda_t,//presto
220    column_definition_list_t, // postgres
221    execute_stmt_t,//snowflake, res := (execute immediate :select_statement);
222    geo_t,//postgresql
223    network_t, //postgresql
224    text_search_t,//postgresql
225    json_access_t,//databricks
226    json_path_t,//databricks
227    typecast_t, // in syntax like: expr typecast datatype, expr typecast datatype
228    typecast_datatype_t,//databricks,postgresql,gaussdb,greenplum in syntax like: datatype(expr),   bigint(expr)
229    implicit_datatype_cast_as_t,// in syntax like: expr as datatype
230    /**
231     * Oracle syntax for parenthesized expression with property access
232     * Represents syntax like: (relation_module.get_first_parent('APP', app.appid)).id
233     */
234    parenthesized_property_access_t,
235}
236