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