-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into wkx/risingwave-streaming-features
- Loading branch information
Showing
31 changed files
with
277 additions
and
147 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
4 changes: 2 additions & 2 deletions
4
...ze/tutorials/open-source-software/apache-flink/1_single_feature/execute-results/html.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out1.sql
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
locate("t0"."string_col", 'a') - 1 AS "StringFind(string_col, 'a')" | ||
position("t0"."string_col", 'a') - 1 AS "StringFind(string_col, 'a')" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out2.sql
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
locate("t0"."string_col", "t0"."string_col") - 1 AS "StringFind(string_col, string_col)" | ||
position("t0"."string_col", "t0"."string_col") - 1 AS "StringFind(string_col, string_col)" | ||
FROM "functional_alltypes" AS "t0" |
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
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,48 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
from pyflink.common.types import Row | ||
|
||
import ibis | ||
from ibis.backends.tests.errors import Py4JJavaError | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data,schema,expected", | ||
[ | ||
pytest.param( | ||
{"value": [{"a": 1}, {"a": 2}]}, | ||
{"value": "!struct<a: !int>"}, | ||
[Row(Row([1])), Row(Row([2]))], | ||
id="simple_named_struct", | ||
), | ||
pytest.param( | ||
{"value": [[{"a": 1}, {"a": 2}], [{"a": 3}, {"a": 4}]]}, | ||
{"value": "!array<!struct<a: !int>>"}, | ||
[Row([Row([1]), Row([2])]), Row([Row([3]), Row([4])])], | ||
id="single_field_named_struct_array", | ||
), | ||
pytest.param( | ||
{"value": [[{"a": 1, "b": 2}, {"a": 2, "b": 2}]]}, | ||
{"value": "!array<!struct<a: !int, b: !int>>"}, | ||
[Row([Row([1, 2]), Row([2, 2])])], | ||
id="named_struct_array", | ||
), | ||
], | ||
) | ||
def test_create_memtable(con, data, schema, expected): | ||
t = ibis.memtable(data, schema=ibis.schema(schema)) | ||
# cannot use con.execute(t) directly because of some behavioral discrepancy between | ||
# `TableEnvironment.execute_sql()` and `TableEnvironment.sql_query()` | ||
result = con.raw_sql(con.compile(t)) | ||
# raw_sql() returns a `TableResult` object and doesn't natively convert to pandas | ||
assert list(result.collect()) == expected | ||
|
||
|
||
@pytest.mark.notyet( | ||
["flink"], | ||
raises=Py4JJavaError, | ||
reason="cannot create an ARRAY of named STRUCTs directly from the ARRAY[] constructor; https://issues.apache.org/jira/browse/FLINK-34898", | ||
) | ||
def test_create_named_struct_array_with_array_constructor(con): | ||
con.raw_sql("SELECT ARRAY[cast(ROW(1) as ROW<a INT>)];") |
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
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
Oops, something went wrong.