diff --git a/src/snowflake/snowpark/_internal/proto/ast.proto b/src/snowflake/snowpark/_internal/proto/ast.proto index f8e612cf341..80bbf52c792 100644 --- a/src/snowflake/snowpark/_internal/proto/ast.proto +++ b/src/snowflake/snowpark/_internal/proto/ast.proto @@ -1,4 +1,4 @@ -// N.B. This file is generated by `ir-dsl-c`. DO NOT EDIT! +// N.B. This file is generated by `//Snowpark/ir-dsl-c`. DO NOT EDIT! // Generated from `{git@github.com:snowflakedb/snowflake.git}/Snowpark/ast`. syntax = "proto3"; @@ -283,6 +283,15 @@ message SpJoinType { } } +// sp-col-expr.ir:70 +message SpNullOrder { + oneof variant { + bool sp_null_order_default = 1; + bool sp_null_order_nulls_first = 2; + bool sp_null_order_nulls_last = 3; + } +} + // sp-type.ir:88 message SpPivotValue { oneof sealed_value { @@ -673,142 +682,141 @@ message Expr { SpColumnDesc sp_column_desc = 63; SpColumnEqualNan sp_column_equal_nan = 64; SpColumnEqualNull sp_column_equal_null = 65; - SpColumnIn_Dataframe sp_column_in__dataframe = 66; - SpColumnIn_Seq sp_column_in__seq = 67; - SpColumnIsNotNull sp_column_is_not_null = 68; - SpColumnIsNull sp_column_is_null = 69; - SpColumnOver sp_column_over = 70; - SpColumnRef sp_column_ref = 71; - SpColumnSqlExpr sp_column_sql_expr = 72; - SpColumnStringCollate sp_column_string_collate = 73; - SpColumnStringContains sp_column_string_contains = 74; - SpColumnStringEndsWith sp_column_string_ends_with = 75; - SpColumnStringLike sp_column_string_like = 76; - SpColumnStringRegexp sp_column_string_regexp = 77; - SpColumnStringStartsWith sp_column_string_starts_with = 78; - SpColumnStringSubstr sp_column_string_substr = 79; - SpColumnTryCast sp_column_try_cast = 80; - SpColumnWithinGroup sp_column_within_group = 81; - SpCreateDataframe sp_create_dataframe = 82; - SpDataframeAgg sp_dataframe_agg = 83; - SpDataframeAlias sp_dataframe_alias = 84; - SpDataframeAnalyticsComputeLag sp_dataframe_analytics_compute_lag = 85; - SpDataframeAnalyticsComputeLead sp_dataframe_analytics_compute_lead = 86; - SpDataframeAnalyticsCumulativeAgg sp_dataframe_analytics_cumulative_agg = 87; - SpDataframeAnalyticsMovingAgg sp_dataframe_analytics_moving_agg = 88; - SpDataframeAnalyticsTimeSeriesAgg sp_dataframe_analytics_time_series_agg = 89; - SpDataframeApply sp_dataframe_apply = 90; - SpDataframeCacheResult sp_dataframe_cache_result = 91; - SpDataframeCol sp_dataframe_col = 92; - SpDataframeCollect sp_dataframe_collect = 93; - SpDataframeCopyIntoTable sp_dataframe_copy_into_table = 94; - SpDataframeCount sp_dataframe_count = 95; - SpDataframeCreateOrReplaceDynamicTable sp_dataframe_create_or_replace_dynamic_table = 96; - SpDataframeCreateOrReplaceView sp_dataframe_create_or_replace_view = 97; - SpDataframeCrossJoin sp_dataframe_cross_join = 98; - SpDataframeCube sp_dataframe_cube = 99; - SpDataframeDescribe sp_dataframe_describe = 100; - SpDataframeDistinct sp_dataframe_distinct = 101; - SpDataframeDrop sp_dataframe_drop = 102; - SpDataframeDropDuplicates sp_dataframe_drop_duplicates = 103; - SpDataframeExcept sp_dataframe_except = 104; - SpDataframeFilter sp_dataframe_filter = 105; - SpDataframeFirst sp_dataframe_first = 106; - SpDataframeFlatten sp_dataframe_flatten = 107; - SpDataframeGroupBy sp_dataframe_group_by = 108; - SpDataframeGroupByGroupingSets sp_dataframe_group_by_grouping_sets = 109; - SpDataframeGroupBy_Columns sp_dataframe_group_by__columns = 110; - SpDataframeGroupBy_Strings sp_dataframe_group_by__strings = 111; - SpDataframeIntersect sp_dataframe_intersect = 112; - SpDataframeJoin sp_dataframe_join = 113; - SpDataframeJoinTableFunction sp_dataframe_join_table_function = 114; - SpDataframeJoin_Dataframe_JoinExprs sp_dataframe_join__dataframe__join_exprs = 115; - SpDataframeJoin_Dataframe_UsingColumns sp_dataframe_join__dataframe__using_columns = 116; - SpDataframeLimit sp_dataframe_limit = 117; - SpDataframeNaDrop_Python sp_dataframe_na_drop__python = 118; - SpDataframeNaDrop_Scala sp_dataframe_na_drop__scala = 119; - SpDataframeNaFill sp_dataframe_na_fill = 120; - SpDataframeNaReplace sp_dataframe_na_replace = 121; - SpDataframeNaturalJoin sp_dataframe_natural_join = 122; - SpDataframePivot sp_dataframe_pivot = 123; - SpDataframeRandomSplit sp_dataframe_random_split = 124; - SpDataframeRef sp_dataframe_ref = 125; - SpDataframeRename sp_dataframe_rename = 126; - SpDataframeRollup sp_dataframe_rollup = 127; - SpDataframeRollup_Columns sp_dataframe_rollup__columns = 128; - SpDataframeRollup_Strings sp_dataframe_rollup__strings = 129; - SpDataframeSample sp_dataframe_sample = 130; - SpDataframeSelect_Columns sp_dataframe_select__columns = 131; - SpDataframeSelect_Exprs sp_dataframe_select__exprs = 132; - SpDataframeShow sp_dataframe_show = 133; - SpDataframeSort sp_dataframe_sort = 134; - SpDataframeStatApproxQuantile sp_dataframe_stat_approx_quantile = 135; - SpDataframeStatCorr sp_dataframe_stat_corr = 136; - SpDataframeStatCov sp_dataframe_stat_cov = 137; - SpDataframeStatCrossTab sp_dataframe_stat_cross_tab = 138; - SpDataframeStatSampleBy sp_dataframe_stat_sample_by = 139; - SpDataframeToDf sp_dataframe_to_df = 140; - SpDataframeToLocalIterator sp_dataframe_to_local_iterator = 141; - SpDataframeToPandas sp_dataframe_to_pandas = 142; - SpDataframeToPandasBatches sp_dataframe_to_pandas_batches = 143; - SpDataframeUnion sp_dataframe_union = 144; - SpDataframeUnionAll sp_dataframe_union_all = 145; - SpDataframeUnionAllByName sp_dataframe_union_all_by_name = 146; - SpDataframeUnionByName sp_dataframe_union_by_name = 147; - SpDataframeUnpivot sp_dataframe_unpivot = 148; - SpDataframeWhere sp_dataframe_where = 149; - SpDataframeWithColumn sp_dataframe_with_column = 150; - SpDataframeWithColumnRenamed sp_dataframe_with_column_renamed = 151; - SpDataframeWithColumns sp_dataframe_with_columns = 152; - SpDataframeWrite sp_dataframe_write = 153; - SpDatatypeVal sp_datatype_val = 154; - SpFlatten sp_flatten = 155; - SpFnRef sp_fn_ref = 156; - SpGenerator sp_generator = 157; - SpGroupingSets sp_grouping_sets = 158; - SpMergeDeleteWhenMatchedClause sp_merge_delete_when_matched_clause = 159; - SpMergeInsertWhenNotMatchedClause sp_merge_insert_when_not_matched_clause = 160; - SpMergeUpdateWhenMatchedClause sp_merge_update_when_matched_clause = 161; - SpRange sp_range = 162; - SpReadAvro sp_read_avro = 163; - SpReadCsv sp_read_csv = 164; - SpReadJson sp_read_json = 165; - SpReadOrc sp_read_orc = 166; - SpReadParquet sp_read_parquet = 167; - SpReadTable sp_read_table = 168; - SpReadXml sp_read_xml = 169; - SpRelationalGroupedDataframeAgg sp_relational_grouped_dataframe_agg = 170; - SpRelationalGroupedDataframeApplyInPandas sp_relational_grouped_dataframe_apply_in_pandas = 171; - SpRelationalGroupedDataframeBuiltin sp_relational_grouped_dataframe_builtin = 172; - SpRelationalGroupedDataframePivot sp_relational_grouped_dataframe_pivot = 173; - SpRelationalGroupedDataframeRef sp_relational_grouped_dataframe_ref = 174; - SpRow sp_row = 175; - SpSessionTableFunction sp_session_table_function = 176; - SpSql sp_sql = 177; - SpTable sp_table = 178; - SpTableDelete sp_table_delete = 179; - SpTableDropTable sp_table_drop_table = 180; - SpTableFnCallAlias sp_table_fn_call_alias = 181; - SpTableFnCallOver sp_table_fn_call_over = 182; - SpTableMerge sp_table_merge = 183; - SpTableSample sp_table_sample = 184; - SpTableUpdate sp_table_update = 185; - SpToSnowparkPandas sp_to_snowpark_pandas = 186; - SpWriteCopyIntoLocation sp_write_copy_into_location = 187; - SpWriteCsv sp_write_csv = 188; - SpWriteJson sp_write_json = 189; - SpWritePandas sp_write_pandas = 190; - SpWriteParquet sp_write_parquet = 191; - SpWriteTable sp_write_table = 192; - StoredProcedure stored_procedure = 193; - StringVal string_val = 194; - Sub sub = 195; - TimeVal time_val = 196; - TimestampVal timestamp_val = 197; - TupleVal tuple_val = 198; - Udaf udaf = 199; - Udf udf = 200; - Udtf udtf = 201; + SpColumnIn sp_column_in = 66; + SpColumnIsNotNull sp_column_is_not_null = 67; + SpColumnIsNull sp_column_is_null = 68; + SpColumnOver sp_column_over = 69; + SpColumnRef sp_column_ref = 70; + SpColumnSqlExpr sp_column_sql_expr = 71; + SpColumnStringCollate sp_column_string_collate = 72; + SpColumnStringContains sp_column_string_contains = 73; + SpColumnStringEndsWith sp_column_string_ends_with = 74; + SpColumnStringLike sp_column_string_like = 75; + SpColumnStringRegexp sp_column_string_regexp = 76; + SpColumnStringStartsWith sp_column_string_starts_with = 77; + SpColumnStringSubstr sp_column_string_substr = 78; + SpColumnTryCast sp_column_try_cast = 79; + SpColumnWithinGroup sp_column_within_group = 80; + SpCreateDataframe sp_create_dataframe = 81; + SpDataframeAgg sp_dataframe_agg = 82; + SpDataframeAlias sp_dataframe_alias = 83; + SpDataframeAnalyticsComputeLag sp_dataframe_analytics_compute_lag = 84; + SpDataframeAnalyticsComputeLead sp_dataframe_analytics_compute_lead = 85; + SpDataframeAnalyticsCumulativeAgg sp_dataframe_analytics_cumulative_agg = 86; + SpDataframeAnalyticsMovingAgg sp_dataframe_analytics_moving_agg = 87; + SpDataframeAnalyticsTimeSeriesAgg sp_dataframe_analytics_time_series_agg = 88; + SpDataframeApply sp_dataframe_apply = 89; + SpDataframeCacheResult sp_dataframe_cache_result = 90; + SpDataframeCol sp_dataframe_col = 91; + SpDataframeCollect sp_dataframe_collect = 92; + SpDataframeCopyIntoTable sp_dataframe_copy_into_table = 93; + SpDataframeCount sp_dataframe_count = 94; + SpDataframeCreateOrReplaceDynamicTable sp_dataframe_create_or_replace_dynamic_table = 95; + SpDataframeCreateOrReplaceView sp_dataframe_create_or_replace_view = 96; + SpDataframeCrossJoin sp_dataframe_cross_join = 97; + SpDataframeCube sp_dataframe_cube = 98; + SpDataframeDescribe sp_dataframe_describe = 99; + SpDataframeDistinct sp_dataframe_distinct = 100; + SpDataframeDrop sp_dataframe_drop = 101; + SpDataframeDropDuplicates sp_dataframe_drop_duplicates = 102; + SpDataframeExcept sp_dataframe_except = 103; + SpDataframeFilter sp_dataframe_filter = 104; + SpDataframeFirst sp_dataframe_first = 105; + SpDataframeFlatten sp_dataframe_flatten = 106; + SpDataframeGroupBy sp_dataframe_group_by = 107; + SpDataframeGroupByGroupingSets sp_dataframe_group_by_grouping_sets = 108; + SpDataframeGroupBy_Columns sp_dataframe_group_by__columns = 109; + SpDataframeGroupBy_Strings sp_dataframe_group_by__strings = 110; + SpDataframeIntersect sp_dataframe_intersect = 111; + SpDataframeJoin sp_dataframe_join = 112; + SpDataframeJoinTableFunction sp_dataframe_join_table_function = 113; + SpDataframeJoin_Dataframe_JoinExprs sp_dataframe_join__dataframe__join_exprs = 114; + SpDataframeJoin_Dataframe_UsingColumns sp_dataframe_join__dataframe__using_columns = 115; + SpDataframeLimit sp_dataframe_limit = 116; + SpDataframeNaDrop_Python sp_dataframe_na_drop__python = 117; + SpDataframeNaDrop_Scala sp_dataframe_na_drop__scala = 118; + SpDataframeNaFill sp_dataframe_na_fill = 119; + SpDataframeNaReplace sp_dataframe_na_replace = 120; + SpDataframeNaturalJoin sp_dataframe_natural_join = 121; + SpDataframePivot sp_dataframe_pivot = 122; + SpDataframeRandomSplit sp_dataframe_random_split = 123; + SpDataframeRef sp_dataframe_ref = 124; + SpDataframeRename sp_dataframe_rename = 125; + SpDataframeRollup sp_dataframe_rollup = 126; + SpDataframeRollup_Columns sp_dataframe_rollup__columns = 127; + SpDataframeRollup_Strings sp_dataframe_rollup__strings = 128; + SpDataframeSample sp_dataframe_sample = 129; + SpDataframeSelect_Columns sp_dataframe_select__columns = 130; + SpDataframeSelect_Exprs sp_dataframe_select__exprs = 131; + SpDataframeShow sp_dataframe_show = 132; + SpDataframeSort sp_dataframe_sort = 133; + SpDataframeStatApproxQuantile sp_dataframe_stat_approx_quantile = 134; + SpDataframeStatCorr sp_dataframe_stat_corr = 135; + SpDataframeStatCov sp_dataframe_stat_cov = 136; + SpDataframeStatCrossTab sp_dataframe_stat_cross_tab = 137; + SpDataframeStatSampleBy sp_dataframe_stat_sample_by = 138; + SpDataframeToDf sp_dataframe_to_df = 139; + SpDataframeToLocalIterator sp_dataframe_to_local_iterator = 140; + SpDataframeToPandas sp_dataframe_to_pandas = 141; + SpDataframeToPandasBatches sp_dataframe_to_pandas_batches = 142; + SpDataframeUnion sp_dataframe_union = 143; + SpDataframeUnionAll sp_dataframe_union_all = 144; + SpDataframeUnionAllByName sp_dataframe_union_all_by_name = 145; + SpDataframeUnionByName sp_dataframe_union_by_name = 146; + SpDataframeUnpivot sp_dataframe_unpivot = 147; + SpDataframeWhere sp_dataframe_where = 148; + SpDataframeWithColumn sp_dataframe_with_column = 149; + SpDataframeWithColumnRenamed sp_dataframe_with_column_renamed = 150; + SpDataframeWithColumns sp_dataframe_with_columns = 151; + SpDataframeWrite sp_dataframe_write = 152; + SpDatatypeVal sp_datatype_val = 153; + SpFlatten sp_flatten = 154; + SpFnRef sp_fn_ref = 155; + SpGenerator sp_generator = 156; + SpGroupingSets sp_grouping_sets = 157; + SpMergeDeleteWhenMatchedClause sp_merge_delete_when_matched_clause = 158; + SpMergeInsertWhenNotMatchedClause sp_merge_insert_when_not_matched_clause = 159; + SpMergeUpdateWhenMatchedClause sp_merge_update_when_matched_clause = 160; + SpRange sp_range = 161; + SpReadAvro sp_read_avro = 162; + SpReadCsv sp_read_csv = 163; + SpReadJson sp_read_json = 164; + SpReadOrc sp_read_orc = 165; + SpReadParquet sp_read_parquet = 166; + SpReadTable sp_read_table = 167; + SpReadXml sp_read_xml = 168; + SpRelationalGroupedDataframeAgg sp_relational_grouped_dataframe_agg = 169; + SpRelationalGroupedDataframeApplyInPandas sp_relational_grouped_dataframe_apply_in_pandas = 170; + SpRelationalGroupedDataframeBuiltin sp_relational_grouped_dataframe_builtin = 171; + SpRelationalGroupedDataframePivot sp_relational_grouped_dataframe_pivot = 172; + SpRelationalGroupedDataframeRef sp_relational_grouped_dataframe_ref = 173; + SpRow sp_row = 174; + SpSessionTableFunction sp_session_table_function = 175; + SpSql sp_sql = 176; + SpTable sp_table = 177; + SpTableDelete sp_table_delete = 178; + SpTableDropTable sp_table_drop_table = 179; + SpTableFnCallAlias sp_table_fn_call_alias = 180; + SpTableFnCallOver sp_table_fn_call_over = 181; + SpTableMerge sp_table_merge = 182; + SpTableSample sp_table_sample = 183; + SpTableUpdate sp_table_update = 184; + SpToSnowparkPandas sp_to_snowpark_pandas = 185; + SpWriteCopyIntoLocation sp_write_copy_into_location = 186; + SpWriteCsv sp_write_csv = 187; + SpWriteJson sp_write_json = 188; + SpWritePandas sp_write_pandas = 189; + SpWriteParquet sp_write_parquet = 190; + SpWriteTable sp_write_table = 191; + StoredProcedure stored_procedure = 192; + StringVal string_val = 193; + Sub sub = 194; + TimeVal time_val = 195; + TimestampVal timestamp_val = 196; + TupleVal tuple_val = 197; + Udaf udaf = 198; + Udf udf = 199; + Udtf udtf = 200; } } @@ -951,152 +959,151 @@ message HasSrcPosition { SpColumnDesc sp_column_desc = 67; SpColumnEqualNan sp_column_equal_nan = 68; SpColumnEqualNull sp_column_equal_null = 69; - SpColumnIn_Dataframe sp_column_in__dataframe = 70; - SpColumnIn_Seq sp_column_in__seq = 71; - SpColumnIsNotNull sp_column_is_not_null = 72; - SpColumnIsNull sp_column_is_null = 73; - SpColumnOver sp_column_over = 74; - SpColumnRef sp_column_ref = 75; - SpColumnSqlExpr sp_column_sql_expr = 76; - SpColumnStringCollate sp_column_string_collate = 77; - SpColumnStringContains sp_column_string_contains = 78; - SpColumnStringEndsWith sp_column_string_ends_with = 79; - SpColumnStringLike sp_column_string_like = 80; - SpColumnStringRegexp sp_column_string_regexp = 81; - SpColumnStringStartsWith sp_column_string_starts_with = 82; - SpColumnStringSubstr sp_column_string_substr = 83; - SpColumnTryCast sp_column_try_cast = 84; - SpColumnWithinGroup sp_column_within_group = 85; - SpCreateDataframe sp_create_dataframe = 86; - SpDataframeAgg sp_dataframe_agg = 87; - SpDataframeAlias sp_dataframe_alias = 88; - SpDataframeAnalyticsComputeLag sp_dataframe_analytics_compute_lag = 89; - SpDataframeAnalyticsComputeLead sp_dataframe_analytics_compute_lead = 90; - SpDataframeAnalyticsCumulativeAgg sp_dataframe_analytics_cumulative_agg = 91; - SpDataframeAnalyticsMovingAgg sp_dataframe_analytics_moving_agg = 92; - SpDataframeAnalyticsTimeSeriesAgg sp_dataframe_analytics_time_series_agg = 93; - SpDataframeApply sp_dataframe_apply = 94; - SpDataframeCacheResult sp_dataframe_cache_result = 95; - SpDataframeCol sp_dataframe_col = 96; - SpDataframeCollect sp_dataframe_collect = 97; - SpDataframeCopyIntoTable sp_dataframe_copy_into_table = 98; - SpDataframeCount sp_dataframe_count = 99; - SpDataframeCreateOrReplaceDynamicTable sp_dataframe_create_or_replace_dynamic_table = 100; - SpDataframeCreateOrReplaceView sp_dataframe_create_or_replace_view = 101; - SpDataframeCrossJoin sp_dataframe_cross_join = 102; - SpDataframeCube sp_dataframe_cube = 103; - SpDataframeDescribe sp_dataframe_describe = 104; - SpDataframeDistinct sp_dataframe_distinct = 105; - SpDataframeDrop sp_dataframe_drop = 106; - SpDataframeDropDuplicates sp_dataframe_drop_duplicates = 107; - SpDataframeExcept sp_dataframe_except = 108; - SpDataframeFilter sp_dataframe_filter = 109; - SpDataframeFirst sp_dataframe_first = 110; - SpDataframeFlatten sp_dataframe_flatten = 111; - SpDataframeGroupBy sp_dataframe_group_by = 112; - SpDataframeGroupByGroupingSets sp_dataframe_group_by_grouping_sets = 113; - SpDataframeGroupBy_Columns sp_dataframe_group_by__columns = 114; - SpDataframeGroupBy_Strings sp_dataframe_group_by__strings = 115; - SpDataframeIntersect sp_dataframe_intersect = 116; - SpDataframeJoin sp_dataframe_join = 117; - SpDataframeJoinTableFunction sp_dataframe_join_table_function = 118; - SpDataframeJoin_Dataframe_JoinExprs sp_dataframe_join__dataframe__join_exprs = 119; - SpDataframeJoin_Dataframe_UsingColumns sp_dataframe_join__dataframe__using_columns = 120; - SpDataframeLimit sp_dataframe_limit = 121; - SpDataframeNaDrop_Python sp_dataframe_na_drop__python = 122; - SpDataframeNaDrop_Scala sp_dataframe_na_drop__scala = 123; - SpDataframeNaFill sp_dataframe_na_fill = 124; - SpDataframeNaReplace sp_dataframe_na_replace = 125; - SpDataframeNaturalJoin sp_dataframe_natural_join = 126; - SpDataframePivot sp_dataframe_pivot = 127; - SpDataframeRandomSplit sp_dataframe_random_split = 128; - SpDataframeReaderInit sp_dataframe_reader_init = 129; - SpDataframeReaderOption sp_dataframe_reader_option = 130; - SpDataframeReaderOptions sp_dataframe_reader_options = 131; - SpDataframeReaderSchema sp_dataframe_reader_schema = 132; - SpDataframeReaderWithMetadata sp_dataframe_reader_with_metadata = 133; - SpDataframeRef sp_dataframe_ref = 134; - SpDataframeRename sp_dataframe_rename = 135; - SpDataframeRollup sp_dataframe_rollup = 136; - SpDataframeRollup_Columns sp_dataframe_rollup__columns = 137; - SpDataframeRollup_Strings sp_dataframe_rollup__strings = 138; - SpDataframeSample sp_dataframe_sample = 139; - SpDataframeSelect_Columns sp_dataframe_select__columns = 140; - SpDataframeSelect_Exprs sp_dataframe_select__exprs = 141; - SpDataframeShow sp_dataframe_show = 142; - SpDataframeSort sp_dataframe_sort = 143; - SpDataframeStatApproxQuantile sp_dataframe_stat_approx_quantile = 144; - SpDataframeStatCorr sp_dataframe_stat_corr = 145; - SpDataframeStatCov sp_dataframe_stat_cov = 146; - SpDataframeStatCrossTab sp_dataframe_stat_cross_tab = 147; - SpDataframeStatSampleBy sp_dataframe_stat_sample_by = 148; - SpDataframeToDf sp_dataframe_to_df = 149; - SpDataframeToLocalIterator sp_dataframe_to_local_iterator = 150; - SpDataframeToPandas sp_dataframe_to_pandas = 151; - SpDataframeToPandasBatches sp_dataframe_to_pandas_batches = 152; - SpDataframeUnion sp_dataframe_union = 153; - SpDataframeUnionAll sp_dataframe_union_all = 154; - SpDataframeUnionAllByName sp_dataframe_union_all_by_name = 155; - SpDataframeUnionByName sp_dataframe_union_by_name = 156; - SpDataframeUnpivot sp_dataframe_unpivot = 157; - SpDataframeWhere sp_dataframe_where = 158; - SpDataframeWithColumn sp_dataframe_with_column = 159; - SpDataframeWithColumnRenamed sp_dataframe_with_column_renamed = 160; - SpDataframeWithColumns sp_dataframe_with_columns = 161; - SpDataframeWrite sp_dataframe_write = 162; - SpDatatypeVal sp_datatype_val = 163; - SpFlatten sp_flatten = 164; - SpFnRef sp_fn_ref = 165; - SpGenerator sp_generator = 166; - SpGroupingSets sp_grouping_sets = 167; - SpMergeDeleteWhenMatchedClause sp_merge_delete_when_matched_clause = 168; - SpMergeInsertWhenNotMatchedClause sp_merge_insert_when_not_matched_clause = 169; - SpMergeUpdateWhenMatchedClause sp_merge_update_when_matched_clause = 170; - SpRange sp_range = 171; - SpReadAvro sp_read_avro = 172; - SpReadCsv sp_read_csv = 173; - SpReadJson sp_read_json = 174; - SpReadOrc sp_read_orc = 175; - SpReadParquet sp_read_parquet = 176; - SpReadTable sp_read_table = 177; - SpReadXml sp_read_xml = 178; - SpRelationalGroupedDataframeAgg sp_relational_grouped_dataframe_agg = 179; - SpRelationalGroupedDataframeApplyInPandas sp_relational_grouped_dataframe_apply_in_pandas = 180; - SpRelationalGroupedDataframeBuiltin sp_relational_grouped_dataframe_builtin = 181; - SpRelationalGroupedDataframePivot sp_relational_grouped_dataframe_pivot = 182; - SpRelationalGroupedDataframeRef sp_relational_grouped_dataframe_ref = 183; - SpRow sp_row = 184; - SpSessionTableFunction sp_session_table_function = 185; - SpSql sp_sql = 186; - SpTable sp_table = 187; - SpTableDelete sp_table_delete = 188; - SpTableDropTable sp_table_drop_table = 189; - SpTableFnCallAlias sp_table_fn_call_alias = 190; - SpTableFnCallOver sp_table_fn_call_over = 191; - SpTableMerge sp_table_merge = 192; - SpTableSample sp_table_sample = 193; - SpTableUpdate sp_table_update = 194; - SpToSnowparkPandas sp_to_snowpark_pandas = 195; - SpWindowSpecEmpty sp_window_spec_empty = 196; - SpWindowSpecOrderBy sp_window_spec_order_by = 197; - SpWindowSpecPartitionBy sp_window_spec_partition_by = 198; - SpWindowSpecRangeBetween sp_window_spec_range_between = 199; - SpWindowSpecRowsBetween sp_window_spec_rows_between = 200; - SpWriteCopyIntoLocation sp_write_copy_into_location = 201; - SpWriteCsv sp_write_csv = 202; - SpWriteJson sp_write_json = 203; - SpWritePandas sp_write_pandas = 204; - SpWriteParquet sp_write_parquet = 205; - SpWriteTable sp_write_table = 206; - StoredProcedure stored_procedure = 207; - StringVal string_val = 208; - Sub sub = 209; - TimeVal time_val = 210; - TimestampVal timestamp_val = 211; - TupleVal tuple_val = 212; - Udaf udaf = 213; - Udf udf = 214; - Udtf udtf = 215; + SpColumnIn sp_column_in = 70; + SpColumnIsNotNull sp_column_is_not_null = 71; + SpColumnIsNull sp_column_is_null = 72; + SpColumnOver sp_column_over = 73; + SpColumnRef sp_column_ref = 74; + SpColumnSqlExpr sp_column_sql_expr = 75; + SpColumnStringCollate sp_column_string_collate = 76; + SpColumnStringContains sp_column_string_contains = 77; + SpColumnStringEndsWith sp_column_string_ends_with = 78; + SpColumnStringLike sp_column_string_like = 79; + SpColumnStringRegexp sp_column_string_regexp = 80; + SpColumnStringStartsWith sp_column_string_starts_with = 81; + SpColumnStringSubstr sp_column_string_substr = 82; + SpColumnTryCast sp_column_try_cast = 83; + SpColumnWithinGroup sp_column_within_group = 84; + SpCreateDataframe sp_create_dataframe = 85; + SpDataframeAgg sp_dataframe_agg = 86; + SpDataframeAlias sp_dataframe_alias = 87; + SpDataframeAnalyticsComputeLag sp_dataframe_analytics_compute_lag = 88; + SpDataframeAnalyticsComputeLead sp_dataframe_analytics_compute_lead = 89; + SpDataframeAnalyticsCumulativeAgg sp_dataframe_analytics_cumulative_agg = 90; + SpDataframeAnalyticsMovingAgg sp_dataframe_analytics_moving_agg = 91; + SpDataframeAnalyticsTimeSeriesAgg sp_dataframe_analytics_time_series_agg = 92; + SpDataframeApply sp_dataframe_apply = 93; + SpDataframeCacheResult sp_dataframe_cache_result = 94; + SpDataframeCol sp_dataframe_col = 95; + SpDataframeCollect sp_dataframe_collect = 96; + SpDataframeCopyIntoTable sp_dataframe_copy_into_table = 97; + SpDataframeCount sp_dataframe_count = 98; + SpDataframeCreateOrReplaceDynamicTable sp_dataframe_create_or_replace_dynamic_table = 99; + SpDataframeCreateOrReplaceView sp_dataframe_create_or_replace_view = 100; + SpDataframeCrossJoin sp_dataframe_cross_join = 101; + SpDataframeCube sp_dataframe_cube = 102; + SpDataframeDescribe sp_dataframe_describe = 103; + SpDataframeDistinct sp_dataframe_distinct = 104; + SpDataframeDrop sp_dataframe_drop = 105; + SpDataframeDropDuplicates sp_dataframe_drop_duplicates = 106; + SpDataframeExcept sp_dataframe_except = 107; + SpDataframeFilter sp_dataframe_filter = 108; + SpDataframeFirst sp_dataframe_first = 109; + SpDataframeFlatten sp_dataframe_flatten = 110; + SpDataframeGroupBy sp_dataframe_group_by = 111; + SpDataframeGroupByGroupingSets sp_dataframe_group_by_grouping_sets = 112; + SpDataframeGroupBy_Columns sp_dataframe_group_by__columns = 113; + SpDataframeGroupBy_Strings sp_dataframe_group_by__strings = 114; + SpDataframeIntersect sp_dataframe_intersect = 115; + SpDataframeJoin sp_dataframe_join = 116; + SpDataframeJoinTableFunction sp_dataframe_join_table_function = 117; + SpDataframeJoin_Dataframe_JoinExprs sp_dataframe_join__dataframe__join_exprs = 118; + SpDataframeJoin_Dataframe_UsingColumns sp_dataframe_join__dataframe__using_columns = 119; + SpDataframeLimit sp_dataframe_limit = 120; + SpDataframeNaDrop_Python sp_dataframe_na_drop__python = 121; + SpDataframeNaDrop_Scala sp_dataframe_na_drop__scala = 122; + SpDataframeNaFill sp_dataframe_na_fill = 123; + SpDataframeNaReplace sp_dataframe_na_replace = 124; + SpDataframeNaturalJoin sp_dataframe_natural_join = 125; + SpDataframePivot sp_dataframe_pivot = 126; + SpDataframeRandomSplit sp_dataframe_random_split = 127; + SpDataframeReaderInit sp_dataframe_reader_init = 128; + SpDataframeReaderOption sp_dataframe_reader_option = 129; + SpDataframeReaderOptions sp_dataframe_reader_options = 130; + SpDataframeReaderSchema sp_dataframe_reader_schema = 131; + SpDataframeReaderWithMetadata sp_dataframe_reader_with_metadata = 132; + SpDataframeRef sp_dataframe_ref = 133; + SpDataframeRename sp_dataframe_rename = 134; + SpDataframeRollup sp_dataframe_rollup = 135; + SpDataframeRollup_Columns sp_dataframe_rollup__columns = 136; + SpDataframeRollup_Strings sp_dataframe_rollup__strings = 137; + SpDataframeSample sp_dataframe_sample = 138; + SpDataframeSelect_Columns sp_dataframe_select__columns = 139; + SpDataframeSelect_Exprs sp_dataframe_select__exprs = 140; + SpDataframeShow sp_dataframe_show = 141; + SpDataframeSort sp_dataframe_sort = 142; + SpDataframeStatApproxQuantile sp_dataframe_stat_approx_quantile = 143; + SpDataframeStatCorr sp_dataframe_stat_corr = 144; + SpDataframeStatCov sp_dataframe_stat_cov = 145; + SpDataframeStatCrossTab sp_dataframe_stat_cross_tab = 146; + SpDataframeStatSampleBy sp_dataframe_stat_sample_by = 147; + SpDataframeToDf sp_dataframe_to_df = 148; + SpDataframeToLocalIterator sp_dataframe_to_local_iterator = 149; + SpDataframeToPandas sp_dataframe_to_pandas = 150; + SpDataframeToPandasBatches sp_dataframe_to_pandas_batches = 151; + SpDataframeUnion sp_dataframe_union = 152; + SpDataframeUnionAll sp_dataframe_union_all = 153; + SpDataframeUnionAllByName sp_dataframe_union_all_by_name = 154; + SpDataframeUnionByName sp_dataframe_union_by_name = 155; + SpDataframeUnpivot sp_dataframe_unpivot = 156; + SpDataframeWhere sp_dataframe_where = 157; + SpDataframeWithColumn sp_dataframe_with_column = 158; + SpDataframeWithColumnRenamed sp_dataframe_with_column_renamed = 159; + SpDataframeWithColumns sp_dataframe_with_columns = 160; + SpDataframeWrite sp_dataframe_write = 161; + SpDatatypeVal sp_datatype_val = 162; + SpFlatten sp_flatten = 163; + SpFnRef sp_fn_ref = 164; + SpGenerator sp_generator = 165; + SpGroupingSets sp_grouping_sets = 166; + SpMergeDeleteWhenMatchedClause sp_merge_delete_when_matched_clause = 167; + SpMergeInsertWhenNotMatchedClause sp_merge_insert_when_not_matched_clause = 168; + SpMergeUpdateWhenMatchedClause sp_merge_update_when_matched_clause = 169; + SpRange sp_range = 170; + SpReadAvro sp_read_avro = 171; + SpReadCsv sp_read_csv = 172; + SpReadJson sp_read_json = 173; + SpReadOrc sp_read_orc = 174; + SpReadParquet sp_read_parquet = 175; + SpReadTable sp_read_table = 176; + SpReadXml sp_read_xml = 177; + SpRelationalGroupedDataframeAgg sp_relational_grouped_dataframe_agg = 178; + SpRelationalGroupedDataframeApplyInPandas sp_relational_grouped_dataframe_apply_in_pandas = 179; + SpRelationalGroupedDataframeBuiltin sp_relational_grouped_dataframe_builtin = 180; + SpRelationalGroupedDataframePivot sp_relational_grouped_dataframe_pivot = 181; + SpRelationalGroupedDataframeRef sp_relational_grouped_dataframe_ref = 182; + SpRow sp_row = 183; + SpSessionTableFunction sp_session_table_function = 184; + SpSql sp_sql = 185; + SpTable sp_table = 186; + SpTableDelete sp_table_delete = 187; + SpTableDropTable sp_table_drop_table = 188; + SpTableFnCallAlias sp_table_fn_call_alias = 189; + SpTableFnCallOver sp_table_fn_call_over = 190; + SpTableMerge sp_table_merge = 191; + SpTableSample sp_table_sample = 192; + SpTableUpdate sp_table_update = 193; + SpToSnowparkPandas sp_to_snowpark_pandas = 194; + SpWindowSpecEmpty sp_window_spec_empty = 195; + SpWindowSpecOrderBy sp_window_spec_order_by = 196; + SpWindowSpecPartitionBy sp_window_spec_partition_by = 197; + SpWindowSpecRangeBetween sp_window_spec_range_between = 198; + SpWindowSpecRowsBetween sp_window_spec_rows_between = 199; + SpWriteCopyIntoLocation sp_write_copy_into_location = 200; + SpWriteCsv sp_write_csv = 201; + SpWriteJson sp_write_json = 202; + SpWritePandas sp_write_pandas = 203; + SpWriteParquet sp_write_parquet = 204; + SpWriteTable sp_write_table = 205; + StoredProcedure stored_procedure = 206; + StringVal string_val = 207; + Sub sub = 208; + TimeVal time_val = 209; + TimestampVal timestamp_val = 210; + TupleVal tuple_val = 211; + Udaf udaf = 212; + Udf udf = 213; + Udtf udtf = 214; } } @@ -1326,7 +1333,7 @@ message SpColumnApply_String { // sp-col-expr.ir:49 message SpColumnAsc { Expr col = 1; - google.protobuf.BoolValue nulls_first = 2; + SpNullOrder null_order = 2; SrcPosition src = 3; } @@ -1354,17 +1361,17 @@ message SpColumnCast { // sp-col-expr.ir:66 message SpColumnDesc { Expr col = 1; - google.protobuf.BoolValue nulls_first = 2; + SpNullOrder null_order = 2; SrcPosition src = 3; } -// sp-col-expr.ir:70 +// sp-col-expr.ir:72 message SpColumnEqualNan { Expr col = 1; SrcPosition src = 2; } -// sp-col-expr.ir:72 +// sp-col-expr.ir:74 message SpColumnEqualNull { Expr lhs = 1; Expr rhs = 2; @@ -1392,50 +1399,42 @@ message SpColumnFn { SpColumnCast sp_column_cast = 6; SpColumnDesc sp_column_desc = 7; SpColumnEqualNan sp_column_equal_nan = 8; - SpColumnIn_Dataframe sp_column_in__dataframe = 9; - SpColumnIn_Seq sp_column_in__seq = 10; - SpColumnIsNotNull sp_column_is_not_null = 11; - SpColumnIsNull sp_column_is_null = 12; - SpColumnOver sp_column_over = 13; - SpColumnStringCollate sp_column_string_collate = 14; - SpColumnStringContains sp_column_string_contains = 15; - SpColumnStringEndsWith sp_column_string_ends_with = 16; - SpColumnStringLike sp_column_string_like = 17; - SpColumnStringRegexp sp_column_string_regexp = 18; - SpColumnStringStartsWith sp_column_string_starts_with = 19; - SpColumnStringSubstr sp_column_string_substr = 20; - SpColumnTryCast sp_column_try_cast = 21; - SpColumnWithinGroup sp_column_within_group = 22; + SpColumnIn sp_column_in = 9; + SpColumnIsNotNull sp_column_is_not_null = 10; + SpColumnIsNull sp_column_is_null = 11; + SpColumnOver sp_column_over = 12; + SpColumnStringCollate sp_column_string_collate = 13; + SpColumnStringContains sp_column_string_contains = 14; + SpColumnStringEndsWith sp_column_string_ends_with = 15; + SpColumnStringLike sp_column_string_like = 16; + SpColumnStringRegexp sp_column_string_regexp = 17; + SpColumnStringStartsWith sp_column_string_starts_with = 18; + SpColumnStringSubstr sp_column_string_substr = 19; + SpColumnTryCast sp_column_try_cast = 20; + SpColumnWithinGroup sp_column_within_group = 21; } } -// sp-col-expr.ir:77 -message SpColumnIn_Dataframe { - Expr col = 1; - SpDataframeExpr df = 2; - SrcPosition src = 3; -} - -// sp-col-expr.ir:81 -message SpColumnIn_Seq { +// sp-col-expr.ir:79 +message SpColumnIn { Expr col = 1; SrcPosition src = 2; repeated Expr values = 3; } -// sp-col-expr.ir:85 +// sp-col-expr.ir:83 message SpColumnIsNotNull { Expr col = 1; SrcPosition src = 2; } -// sp-col-expr.ir:87 +// sp-col-expr.ir:85 message SpColumnIsNull { Expr col = 1; SrcPosition src = 2; } -// sp-col-expr.ir:89 +// sp-col-expr.ir:87 message SpColumnOver { Expr col = 1; SrcPosition src = 2; @@ -1455,35 +1454,35 @@ message SpColumnSqlExpr { SrcPosition src = 3; } -// sp-col-expr.ir:119 +// sp-col-expr.ir:117 message SpColumnStringCollate { Expr col = 1; Expr collation_spec = 2; SrcPosition src = 3; } -// sp-col-expr.ir:123 +// sp-col-expr.ir:121 message SpColumnStringContains { Expr col = 1; Expr pattern = 2; SrcPosition src = 3; } -// sp-col-expr.ir:110 +// sp-col-expr.ir:108 message SpColumnStringEndsWith { Expr col = 1; SrcPosition src = 2; Expr suffix = 3; } -// sp-col-expr.ir:97 +// sp-col-expr.ir:95 message SpColumnStringLike { Expr col = 1; Expr pattern = 2; SrcPosition src = 3; } -// sp-col-expr.ir:101 +// sp-col-expr.ir:99 message SpColumnStringRegexp { Expr col = 1; Expr parameters = 2; @@ -1491,14 +1490,14 @@ message SpColumnStringRegexp { SrcPosition src = 4; } -// sp-col-expr.ir:106 +// sp-col-expr.ir:104 message SpColumnStringStartsWith { Expr col = 1; Expr prefix = 2; SrcPosition src = 3; } -// sp-col-expr.ir:114 +// sp-col-expr.ir:112 message SpColumnStringSubstr { Expr col = 1; Expr len = 2; @@ -1513,7 +1512,7 @@ message SpColumnTryCast { SpDataType to = 3; } -// sp-col-expr.ir:93 +// sp-col-expr.ir:91 message SpColumnWithinGroup { Expr col = 1; ExprArgList cols = 2; diff --git a/src/snowflake/snowpark/column.py b/src/snowflake/snowpark/column.py index 0b46f7d101b..3f32c981203 100644 --- a/src/snowflake/snowpark/column.py +++ b/src/snowflake/snowpark/column.py @@ -644,7 +644,7 @@ def in_( ast = None if _emit_ast: ast = proto.Expr() - proto_ast = ast.sp_column_in__seq + proto_ast = ast.sp_column_in proto_ast.col.CopyFrom(self._ast) return Column(Literal(False), _ast=ast, _emit_ast=_emit_ast) @@ -699,7 +699,7 @@ def validate_value(value_expr: Expression): ast = None if _emit_ast: ast = proto.Expr() - proto_ast = ast.sp_column_in__seq + proto_ast = ast.sp_column_in proto_ast.col.CopyFrom(self._ast) for val in vals: val_ast = proto_ast.values.add() @@ -952,6 +952,7 @@ def desc(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_desc) ast.col.CopyFrom(self._ast) + ast.null_order.sp_null_order_default = True return Column( SortOrder(self._expression, Descending()), _ast=expr, _emit_ast=_emit_ast ) @@ -965,7 +966,7 @@ def desc_nulls_first(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_desc) ast.col.CopyFrom(self._ast) - ast.nulls_first.value = True + ast.null_order.sp_null_order_nulls_first = True return Column( SortOrder(self._expression, Descending(), NullsFirst()), _ast=expr, @@ -981,7 +982,7 @@ def desc_nulls_last(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_desc) ast.col.CopyFrom(self._ast) - ast.nulls_first.value = False + ast.null_order.sp_null_order_nulls_last = True return Column( SortOrder(self._expression, Descending(), NullsLast()), _ast=expr, @@ -996,6 +997,7 @@ def asc(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_asc) ast.col.CopyFrom(self._ast) + ast.null_order.sp_null_order_default = True return Column( SortOrder(self._expression, Ascending()), _ast=expr, _emit_ast=_emit_ast ) @@ -1009,7 +1011,7 @@ def asc_nulls_first(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_asc) ast.col.CopyFrom(self._ast) - ast.nulls_first.value = True + ast.null_order.sp_null_order_nulls_first = True return Column( SortOrder(self._expression, Ascending(), NullsFirst()), _ast=expr, @@ -1025,7 +1027,7 @@ def asc_nulls_last(self, _emit_ast: bool = True) -> "Column": expr = proto.Expr() ast = with_src_position(expr.sp_column_asc) ast.col.CopyFrom(self._ast) - ast.nulls_first.value = False + ast.null_order.sp_null_order_nulls_last = True return Column( SortOrder(self._expression, Ascending(), NullsLast()), _ast=expr, diff --git a/tests/ast/data/col_asc.test b/tests/ast/data/col_asc.test index d938cd948bf..90a8d4612e1 100644 --- a/tests/ast/data/col_asc.test +++ b/tests/ast/data/col_asc.test @@ -90,6 +90,9 @@ body { } } } + null_order { + sp_null_order_default: true + } src { end_column: 37 end_line: 29 @@ -163,8 +166,8 @@ body { } } } - nulls_first { - value: true + null_order { + sp_null_order_nulls_first: true } src { end_column: 49 @@ -239,7 +242,8 @@ body { } } } - nulls_first { + null_order { + sp_null_order_nulls_last: true } src { end_column: 48 diff --git a/tests/ast/data/col_desc.test b/tests/ast/data/col_desc.test index 4156c2d0c0b..97d30879d23 100644 --- a/tests/ast/data/col_desc.test +++ b/tests/ast/data/col_desc.test @@ -88,6 +88,9 @@ body { } } } + null_order { + sp_null_order_default: true + } src { end_column: 38 end_line: 27 @@ -161,8 +164,8 @@ body { } } } - nulls_first { - value: true + null_order { + sp_null_order_nulls_first: true } src { end_column: 50 @@ -237,7 +240,8 @@ body { } } } - nulls_first { + null_order { + sp_null_order_nulls_last: true } src { end_column: 49 diff --git a/tests/ast/data/col_in_.test b/tests/ast/data/col_in_.test index 4d274a9a283..9fee6e2f51d 100644 --- a/tests/ast/data/col_in_.test +++ b/tests/ast/data/col_in_.test @@ -55,7 +55,7 @@ body { expr { sp_dataframe_select__columns { cols { - sp_column_in__seq { + sp_column_in { col { apply_expr { fn { @@ -157,7 +157,7 @@ body { expr { sp_dataframe_select__columns { cols { - sp_column_in__seq { + sp_column_in { col { apply_expr { fn { @@ -230,7 +230,7 @@ body { expr { sp_dataframe_select__columns { cols { - sp_column_in__seq { + sp_column_in { col { apply_expr { fn { diff --git a/tests/ast/data/windows.test b/tests/ast/data/windows.test index 272559c87ad..be96f9fff2d 100644 --- a/tests/ast/data/windows.test +++ b/tests/ast/data/windows.test @@ -557,6 +557,9 @@ body { } } } + null_order { + sp_null_order_default: true + } src { end_column: 51 end_line: 35