We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using Starburst Trino 356-e (LTS) on a single node cluster (same node running coordinator and worker).
I created a table from Trino CLI:
trino:frg96_dataset> CREATE TABLE IF NOT EXISTS -> test ( -> colvarchar VARCHAR, -> colsmallint SMALLINT, -> colint INTEGER, -> colbigint BIGINT, -> coldouble DOUBLE, -> coldecimal DECIMAL(10,3), -> coldate DATE, -> coltimestamp TIMESTAMP(3), -> colvarchar2 VARCHAR, -> colvarchar3 VARCHAR -> ); CREATE TABLE
This created a bigquery table as shown below:
Describe table from Trino:
trino:frg96_dataset> describe test; Column | Type | Extra | Comment --------------+---------------+-------+--------- colvarchar | varchar | | colsmallint | bigint | | colint | bigint | | colbigint | bigint | | coldouble | double | | coldecimal | decimal(38,9) | | coldate | date | | coltimestamp | timestamp(3) | | colvarchar2 | varchar | | colvarchar3 | varchar | | (10 rows) Query 20210603_042500_00006_59a9y, FINISHED, 1 node Splits: 19 total, 19 done (100.00%) 1.23 [10 rows, 730B] [8 rows/s, 592B/s]
Inserted 5 rows into test via BigQuery Cloud Console:
INSERT INTO `gcp-project-id.frg96_dataset.test` VALUES( 'Hello world', 12345, 1234567, 123456789, 12345.678, NUMERIC '12345.678', DATE '2014-09-17', DATETIME '2014-09-17 18:35:54', 'HELLO WORLD 2', 'Hello WORLD 3' );
trino:frg96_dataset> SELECT -> colvarchar, -> colsmallint, -> colint, -> colbigint, -> coldouble, -> colvarchar, -> coldecimal, -> coldate, -> coltimestamp, -> colvarchar2, -> colvarchar3 -> FROM test; colvarchar | colsmallint | colint | colbigint | coldouble | colvarchar | coldecimal | coldate | coltimestamp | colvarchar2 | colvarchar3 -------------+-------------+---------+-----------+-----------+-------------+-----------------+------------+-------------------------+---------------+--------------- Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 | Hello WORLD 3 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 | Hello WORLD 3 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 | Hello WORLD 3 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 | Hello WORLD 3 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 | Hello WORLD 3 (5 rows) Query 20210603_042330_00005_59a9y, FINISHED, 1 node Splits: 17 total, 17 done (100.00%) 4.32 [5 rows, 545B] [1 rows/s, 126B/s]
Query 20210603_042330_00005_59a9y, FINISHED, 1 node Splits: 17 total, 17 done (100.00%) 4.32 [5 rows, 545B] [1 rows/s, 126B/s]
trino:frg96_dataset> -> SELECT -> colvarchar, -> CAST(colsmallint AS SMALLINT) AS colsmallint, -> CAST(colint AS INTEGER) AS colint, -> colbigint, -> coldouble, -> colvarchar, -> coldecimal, -> coldate, -> coltimestamp, -> colvarchar2, -> colvarchar3 -> FROM test; colvarchar | colsmallint | colint | colbigint | coldouble | colvarchar | coldecimal | coldate | coltimestamp | colvarchar2 | colvarchar3 ------------+-------------+---------+-----------+-----------+------------+------------+------------+--------------+---------------+--------------------- NULL | NULL | 1234567 | 123456789 | NULL | NULL | NULL | 2014-09-17 | NULL | HELLO WORLD 2 | 2014-09-17T18:35:54 NULL | NULL | 1234567 | 123456789 | NULL | NULL | NULL | 2014-09-17 | NULL | HELLO WORLD 2 | 2014-09-17T18:35:54 NULL | NULL | 1234567 | 123456789 | NULL | NULL | NULL | 2014-09-17 | NULL | HELLO WORLD 2 | 2014-09-17T18:35:54 NULL | NULL | 1234567 | 123456789 | NULL | NULL | NULL | 2014-09-17 | NULL | HELLO WORLD 2 | 2014-09-17T18:35:54 NULL | NULL | 1234567 | 123456789 | NULL | NULL | NULL | 2014-09-17 | NULL | HELLO WORLD 2 | 2014-09-17T18:35:54 (5 rows) Query 20210603_042802_00008_59a9y, FINISHED, 1 node Splits: 17 total, 17 done (100.00%) 2.15 [5 rows, 545B] [2 rows/s, 253B/s]
Certain columns return NULL and certain column positions are interchanged. Weirdly, this happens only with this combination of columns. When I remove the last column colvarchar3 from SELECT, it works fine:
colvarchar3
trino:frg96_dataset> SELECT -> colvarchar, -> CAST(colsmallint AS SMALLINT) AS colsmallint, -> CAST(colint AS INTEGER) AS colint, -> colbigint, -> coldouble, -> colvarchar, -> coldecimal, -> coldate, -> coltimestamp, -> colvarchar2 -> FROM test; colvarchar | colsmallint | colint | colbigint | coldouble | colvarchar | coldecimal | coldate | coltimestamp | colvarchar2 -------------+-------------+---------+-----------+-----------+-------------+-----------------+------------+-------------------------+--------------- Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 Hello world | 12345 | 1234567 | 123456789 | 12345.678 | Hello world | 12345.678000000 | 2014-09-17 | 2014-09-17 18:35:54.000 | HELLO WORLD 2 (5 rows) Query 20210603_044921_00011_59a9y, FINISHED, 1 node Splits: 17 total, 17 done (100.00%) 2.22 [5 rows, 470B] [2 rows/s, 212B/s]
The text was updated successfully, but these errors were encountered:
I confirmed this issue happens in upstream. It comes from BigQueryResultPageSource.getNextPage()
BigQueryResultPageSource.getNextPage()
Sorry, something went wrong.
Glad to hear that. Thanks @ebyhr !
Fix wrong result due to column position mismatch in BigQuery
28e753c
Cherry-pick of trinodb/trino#8201 This fixes the bug trinodb/trino#8183 Co-authored-by: yuya.ebihara <[email protected]>
ee5fbda
ebyhr
Successfully merging a pull request may close this issue.
I am using Starburst Trino 356-e (LTS) on a single node cluster (same node running coordinator and worker).
I created a table from Trino CLI:
This created a bigquery table as shown below:
Describe table from Trino:
Inserted 5 rows into test via BigQuery Cloud Console:
When I run a select on all columns, The output is correct as shown:
But When I use CAST for the SMALLINT and INT columns, I get the following as shown below:
Certain columns return NULL and certain column positions are interchanged.
Weirdly, this happens only with this combination of columns. When I remove the last column
colvarchar3
from SELECT, it works fine:Any idea(s) what could be causing this issue?
The text was updated successfully, but these errors were encountered: