Skip to content
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

DATE column type support #10

Open
dtjm opened this issue Jan 22, 2021 · 0 comments
Open

DATE column type support #10

dtjm opened this issue Jan 22, 2021 · 0 comments

Comments

@dtjm
Copy link

dtjm commented Jan 22, 2021

Hello, I've already discussed this with @twdsilva, but while doing some evaluation with Kudu and the Calcite Adapter we found DATE support missing and causing this error on queries against tables which have DATE columns:

0: jdbc:kudu:schemaFactory=com.twilio.kudu.sq> SELECT * FROM "foo" LIMIT 1;
Error: Error while executing SQL "SELECT * FROM "foo" LIMIT 1": Unable to implement EnumerableLimit(fetch=[1]): rowcount = 1.0, cumulative cost = {1101.0 rows, 1102.0 cpu, 0.0 io}, id = 156
  KuduToEnumerableRel: rowcount = 1000.0, cumulative cost = {1100.0 rows, 1101.0 cpu, 0.0 io}, id = 154
    KuduQuery(table=[[kudu, foo]]): rowcount = 1000.0, cumulative cost = {1000.0 rows, 1001.0 cpu, 0.0 io}, id = 125 (state=,code=0)

DDL statements using DATE fail in this manner:

Caused by: java.lang.UnsupportedOperationException: Datatype is not supported DATE
	at com.twilio.kudu.sql.SqlUtil.getKuduDataType(SqlUtil.java:85)
	at org.apache.calcite.sql.SqlColumnDefNode.<init>(SqlColumnDefNode.java:57)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.ColumnDef(KuduSqlParserImpl.java:1203)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.ColumnDefList(KuduSqlParserImpl.java:1232)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.SqlCreateTable(KuduSqlParserImpl.java:1075)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.SqlStmt(KuduSqlParserImpl.java:926)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.SqlStmtEof(KuduSqlParserImpl.java:964)
	at com.twilio.kudu.sql.parser.KuduSqlParserImpl.parseSqlStmtEof(KuduSqlParserImpl.java:205)
	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:153)

from a DDL statement similar to this:

CREATE TABLE IF NOT EXISTS foo (
	processed_date DATE NOT NULL
	PRIMARY KEY (processed_date)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant