-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'snowflakedb:main' into fhe-SNOW-1936603-fix-limit-bug
- Loading branch information
Showing
10 changed files
with
2,502 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,275 @@ | ||
## TEST CASE | ||
|
||
df1 = session.create_dataframe( | ||
[ | ||
["foo", "The quick brown fox jumps over the lazy dog"], | ||
["bar", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"], | ||
], | ||
schema=["name", "text"], | ||
) | ||
|
||
df2 = df1.join_table_function("STRTOK_SPLIT_TO_TABLE", df1["text"], lit(" ")) | ||
|
||
# The following part of the tests is impossible to execute in the mock environment. | ||
|
||
# tokenize_text = ( | ||
# call_table_function("STRTOK_SPLIT_TO_TABLE", df1["text"], lit(" ")) | ||
# .over(partition_by="name") | ||
# .over(order_by="text") | ||
# .alias("ignored1", "ignored2", "ignored3") | ||
# .alias("original_row_number", "token_number", "token") | ||
# ) | ||
|
||
# df3 = df1.join_table_function(tokenize_text) | ||
|
||
# tokenize_text_ref = table_function("STRTOK_SPLIT_TO_TABLE") | ||
# df4 = df1.join_table_function( | ||
# tokenize_text_ref(df1["text"], lit(" ")) | ||
# .over(partition_by="name", order_by="text") | ||
# .alias("original_row_number", "token_number", "token") | ||
# ) | ||
|
||
# df5 = df1.join_table_function( | ||
# tokenize_text_ref(df1["text"], lit(" ,")) | ||
# .over(partition_by="name", order_by="text") | ||
# .alias("row_number", "token_number", "token") | ||
# ) | ||
|
||
## EXPECTED UNPARSER OUTPUT | ||
|
||
df1 = session.create_dataframe([["foo", "The quick brown fox jumps over the lazy dog"], ["bar", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"]], schema=["name", "text"]) | ||
|
||
df2 = df1.join_table_function("STRTOK_SPLIT_TO_TABLE", df1["text"], lit(" ")) | ||
|
||
## EXPECTED ENCODED AST | ||
|
||
interned_value_table { | ||
string_values { | ||
key: -1 | ||
} | ||
string_values { | ||
key: 2 | ||
value: "SRC_POSITION_TEST_MODE" | ||
} | ||
} | ||
body { | ||
assign { | ||
expr { | ||
create_dataframe { | ||
data { | ||
dataframe_data__list { | ||
vs { | ||
list_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
vs { | ||
string_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
v: "foo" | ||
} | ||
} | ||
vs { | ||
string_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
v: "The quick brown fox jumps over the lazy dog" | ||
} | ||
} | ||
} | ||
} | ||
vs { | ||
list_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
vs { | ||
string_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
v: "bar" | ||
} | ||
} | ||
vs { | ||
string_val { | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
v: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
schema { | ||
dataframe_schema__list { | ||
vs: "name" | ||
vs: "text" | ||
} | ||
} | ||
src { | ||
end_column: 9 | ||
end_line: 31 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 25 | ||
} | ||
} | ||
} | ||
symbol { | ||
value: "df1" | ||
} | ||
uid: 1 | ||
var_id { | ||
bitfield1: 1 | ||
} | ||
} | ||
} | ||
body { | ||
assign { | ||
expr { | ||
dataframe_join_table_function { | ||
fn { | ||
apply_expr { | ||
fn { | ||
indirect_table_fn_name_ref { | ||
name { | ||
name { | ||
name_flat { | ||
name: "STRTOK_SPLIT_TO_TABLE" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
pos_args { | ||
dataframe_col { | ||
col_name: "text" | ||
df { | ||
dataframe_ref { | ||
id { | ||
bitfield1: 1 | ||
} | ||
} | ||
} | ||
src { | ||
end_column: 74 | ||
end_line: 33 | ||
file: 2 | ||
start_column: 63 | ||
start_line: 33 | ||
} | ||
} | ||
} | ||
pos_args { | ||
apply_expr { | ||
fn { | ||
builtin_fn { | ||
name { | ||
name { | ||
name_flat { | ||
name: "lit" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
pos_args { | ||
string_val { | ||
src { | ||
end_column: 84 | ||
end_line: 33 | ||
file: 2 | ||
start_column: 76 | ||
start_line: 33 | ||
} | ||
v: " " | ||
} | ||
} | ||
src { | ||
end_column: 84 | ||
end_line: 33 | ||
file: 2 | ||
start_column: 76 | ||
start_line: 33 | ||
} | ||
} | ||
} | ||
src { | ||
end_column: 85 | ||
end_line: 33 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 33 | ||
} | ||
} | ||
} | ||
lhs { | ||
dataframe_ref { | ||
id { | ||
bitfield1: 1 | ||
} | ||
} | ||
} | ||
src { | ||
end_column: 85 | ||
end_line: 33 | ||
file: 2 | ||
start_column: 14 | ||
start_line: 33 | ||
} | ||
} | ||
} | ||
symbol { | ||
value: "df2" | ||
} | ||
uid: 2 | ||
var_id { | ||
bitfield1: 2 | ||
} | ||
} | ||
} | ||
client_ast_version: 1 | ||
client_language { | ||
python_language { | ||
version { | ||
label: "final" | ||
major: 3 | ||
minor: 9 | ||
patch: 1 | ||
} | ||
} | ||
} | ||
client_version { | ||
major: 1 | ||
minor: 29 | ||
} |
40 changes: 0 additions & 40 deletions
40
tests/ast/data/DataFrame.join_table_function.test.DISABLED
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.