New issue

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

Invalid Expression table.ROWTIME when table was created with backticks around name #2176

Open
tkaven opened this Issue Nov 21, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@tkaven
Copy link

tkaven commented Nov 21, 2018

ksql> CREATE TABLE `ks_hgame_projects_n111_table` (userid BIGINT, iscancel INTEGER, tprice DOUBLE, bonus DOUBLE, btimestamp BIGINT, wtimestamp BIGINT, dtimestamp BIGINT, pid BIGINT, lid INTEGER, mid BIGINT, modes INTEGER) WITH (kafka_topic='ks_hgame_projects_n11_stream', KEY='userid', VALUE_FORMAT='JSON');

Message       
---------------
Table created 
---------------
ksql> show tables;

Table Name                   | Kafka Topic                  | Format | Windowed 
---------------------------------------------------------------------------------
ks_hgame_projects_n111_table | ks_hgame_projects_n11_stream | JSON   | false    
---------------------------------------------------------------------------------
ksql> select * from `ks_hgame_projects_n111_table`;
Invalid Expression ks_hgame_projects_n111_table.ROWTIME.
ksql> select p.userid from `ks_hgame_projects_n111_table` p;
1008
6219
6219
^CQuery terminated
ksql> select p.ROWTIME from `ks_hgame_projects_n111_table` p;
1542766804803
^CQuery terminated
ksql> select * from `ks_hgame_projects_n111_table`;
Invalid Expression ks_hgame_projects_n111_table.ROWTIME.
ksql>

@miguno miguno changed the title invalid Expression table.ROWTIME Invalid Expression table.ROWTIME Nov 21, 2018

@miguno

This comment has been minimized.

Copy link
Member

miguno commented Nov 21, 2018

@tkaven : Which version of KSQL are you using?

Also: Can you try the following variant, where the quotes/backticks around the table name are omitted?

-- Try this:
select * from ks_hgame_projects_n111_table;

--- instead of
select * from `ks_hgame_projects_n111_table`;
@tkaven

This comment has been minimized.

Copy link
Author

tkaven commented Nov 22, 2018

@tkaven : Which version of KSQL are you using?

Also: Can you try the following variant, where the quotes/backticks around the table name are omitted?

-- Try this:
select * from ks_hgame_projects_n111_table;

--- instead of
select * from `ks_hgame_projects_n111_table`;

i find out, because
i use '`' to create:

CREATE TABLE ks_hgame_projects_n111_table

my version is 5.0.1

@miguno

This comment has been minimized.

Copy link
Member

miguno commented Nov 22, 2018

@tkaven : I am bit confused now. :-)

Does the variant below work for you or not?

-- Try this:
select * from ks_hgame_projects_n111_table;
@tkaven

This comment has been minimized.

Copy link
Author

tkaven commented Nov 23, 2018

@tkaven : I am bit confused now. :-)

Does the variant below work for you or not?

-- Try this:
select * from ks_hgame_projects_n111_table;

hi, select * from ks_hgame_projects_n111_table; not work for me
but if i create use 'CREATE TABLE ks_hgame_projects_n111_table'
it works!

so in create statement do not use ` at name then every thing is ok

@miguno

This comment has been minimized.

Copy link
Member

miguno commented Nov 23, 2018

@big-andy-coates: Is this something new we need to track on our work on quoted identifiers?

There are at least two things here:

  • CREATE'ing a table/stream with a quoted name should work.
    • This includes the scenario where the quotes aren't needed.
  • SELECT'ing from a table/stream should work with a quoted stream/table name.
    • This includes the scenario where the quotes aren't needed.

@JimGalasyn: We should consider documenting this.

@miguno miguno changed the title Invalid Expression table.ROWTIME Invalid Expression table.ROWTIME when table was created with backticks around name Nov 23, 2018

@miguno miguno added the bug label Nov 23, 2018

@JimGalasyn

This comment has been minimized.

Copy link
Member

JimGalasyn commented Nov 27, 2018

Tracking with internal ticket KSQL-1938.

@rmoff

This comment has been minimized.

Copy link
Contributor

rmoff commented Jan 21, 2019

Another example of where this bug shows is if the object is in non-uppercase and thus requires quoting to reference:

ksql> DESCRIBE "MixedCaseStream";

Name                 : MixedCaseStream
 Field                    | Type
------------------------------------------------------
 ROWTIME                  | BIGINT           (system)
 ROWKEY                   | VARCHAR(STRING)  (system)
 COL1                     | VARCHAR(STRING)
 lowercase_col1           | VARCHAR(STRING)
 MixedCase_COL1           | VARCHAR(STRING)
 UPPERCASE_COL1           | VARCHAR(STRING)
 NOTQUOTED_MIXEDCASE_COL1 | VARCHAR(STRING)
------------------------------------------------------
For runtime statistics and query details run: DESCRIBE EXTENDED <Stream,Table>;
ksql> SELECT * FROM "MixedCaseStream";
Invalid Expression MixedCaseStream.ROWTIME.
ksql>
ksql> SELECT ROWTIME, COL1 FROM "MixedCaseStream" LIMIT 1;
1548071546868 | null
Limit Reached
Query terminated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment