calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Olivelli <eolive...@gmail.com>
Subject Re: Columns with name "value"
Date Fri, 17 Nov 2017 08:32:38 GMT
I see, but unfortunately MySQL allows such id.
Do you think it is not possible at all to add a flag to allow it?
Enrico

Il ven 17 nov 2017, 02:02 Julian Hyde <jhyde@apache.org> ha scritto:

> No, it isn’t possible. VALUE is a reserved keyword in Calcite and in
> standard SQL.
>
> Either quote it or rename the column.
>
> Julian
>
>
> > On Nov 16, 2017, at 6:01 AM, Enrico Olivelli <eolivelli@gmail.com>
> wrote:
> >
> > Is it possible to make Calcite SqlParser accept queries on column with
> name
> > "value" without quoting ?
> > like
> > insert into mytable(name,value values(1,2)
> >
> > I am using Mysql 5.5 conformance and lex
> >
> > below the error
> > Cheers
> > Enrico
> >
> > org.apache.calcite.sql.parser.SqlParseException: Encountered ", value" at
> > line 1, column 37.
> > Was expecting one of:
> >    ")" ...
> >    "CHARACTER" ...
> >    "CHAR" ...
> >    "VARCHAR" ...
> >    "DATE" ...
> >    "TIME" ...
> >    "TIMESTAMP" ...
> >    "DECIMAL" ...
> >    "DEC" ...
> >    "NUMERIC" ...
> >    "BOOLEAN" ...
> >    "INTEGER" ...
> >    "INT" ...
> >    "BINARY" ...
> >    "VARBINARY" ...
> >    "TINYINT" ...
> >    "SMALLINT" ...
> >    "BIGINT" ...
> >    "REAL" ...
> >    "DOUBLE" ...
> >    "FLOAT" ...
> >    "ANY" ...
> >    "MULTISET" ...
> >    <IDENTIFIER> ...
> >    <QUOTED_IDENTIFIER> ...
> >    <BACK_QUOTED_IDENTIFIER> ...
> >    <BRACKET_QUOTED_IDENTIFIER> ...
> >    <UNICODE_QUOTED_IDENTIFIER> ...
> >    "." ...
> >    "," <IDENTIFIER> ...
> >    "," <QUOTED_IDENTIFIER> ...
> >    "," <BACK_QUOTED_IDENTIFIER> ...
> >    "," <BRACKET_QUOTED_IDENTIFIER> ...
> >    "," <UNICODE_QUOTED_IDENTIFIER> ...
> >
> > herddb.model.StatementExecutionException
> > org.apache.calcite.sql.parser.SqlParseException: Encountered ", value" at
> > line 1, column 37.
> > Was expecting one of:
> >    ")" ...
> >    "CHARACTER" ...
> >    "CHAR" ...
> >    "VARCHAR" ...
> >    "DATE" ...
> >    "TIME" ...
> >    "TIMESTAMP" ...
> >    "DECIMAL" ...
> >    "DEC" ...
> >    "NUMERIC" ...
> >    "BOOLEAN" ...
> >    "INTEGER" ...
> >    "INT" ...
> >    "BINARY" ...
> >    "VARBINARY" ...
> >    "TINYINT" ...
> >    "SMALLINT" ...
> >    "BIGINT" ...
> >    "REAL" ...
> >    "DOUBLE" ...
> >    "FLOAT" ...
> >    "ANY" ...
> >    "MULTISET" ...
> >    <IDENTIFIER> ...
> >    <QUOTED_IDENTIFIER> ...
> >    <BACK_QUOTED_IDENTIFIER> ...
> >    <BRACKET_QUOTED_IDENTIFIER> ...
> >    <UNICODE_QUOTED_IDENTIFIER> ...
> >    "." ...
> >    "," <IDENTIFIER> ...
> >    "," <QUOTED_IDENTIFIER> ...
> >    "," <BACK_QUOTED_IDENTIFIER> ...
> >    "," <BRACKET_QUOTED_IDENTIFIER> ...
> >    "," <UNICODE_QUOTED_IDENTIFIER> ...
> >
> >    at herddb.sql.CalcitePlanner.translate(CalcitePlanner.java:249)
> >    at herddb.core.TestUtils.executeUpdate(TestUtils.java:43)
> >    at
> >
> herddb.core.SecondaryIndexAccessSuite.secondaryIndexPrefixScanInSubquery(SecondaryIndexAccessSuite.java:396)
> >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >    at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >    at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >    at java.lang.reflect.Method.invoke(Method.java:498)
> >    at
> >
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> >    at
> >
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> >    at
> >
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> >    at
> >
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> >    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> >    at
> >
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> >    at
> >
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> >    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> >    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> >    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> >    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> >    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> >    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> >    at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:369)
> >    at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:275)
> >    at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:239)
> >    at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:160)
> >    at
> >
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
> >    at
> >
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
> >    at
> >
> org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
> >    at
> > org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
> > Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered
> ",
> > value" at line 1, column 37.
> > Was expecting one of:
> >    ")" ...
> >    "CHARACTER" ...
> >    "CHAR" ...
> >    "VARCHAR" ...
> >    "DATE" ...
> >    "TIME" ...
> >    "TIMESTAMP" ...
> >    "DECIMAL" ...
> >    "DEC" ...
> >    "NUMERIC" ...
> >    "BOOLEAN" ...
> >    "INTEGER" ...
> >    "INT" ...
> >    "BINARY" ...
> >    "VARBINARY" ...
> >    "TINYINT" ...
> >    "SMALLINT" ...
> >    "BIGINT" ...
> >    "REAL" ...
> >    "DOUBLE" ...
> >    "FLOAT" ...
> >    "ANY" ...
> >    "MULTISET" ...
> >    <IDENTIFIER> ...
> >    <QUOTED_IDENTIFIER> ...
> >    <BACK_QUOTED_IDENTIFIER> ...
> >    <BRACKET_QUOTED_IDENTIFIER> ...
> >    <UNICODE_QUOTED_IDENTIFIER> ...
> >    "." ...
> >    "," <IDENTIFIER> ...
> >    "," <QUOTED_IDENTIFIER> ...
> >    "," <BACK_QUOTED_IDENTIFIER> ...
> >    "," <BRACKET_QUOTED_IDENTIFIER> ...
> >    "," <UNICODE_QUOTED_IDENTIFIER> ...
> >
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:350)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:131)
> >    at
> > org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
> >    at
> org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
> >    at org.apache.calcite.prepare.PlannerImpl.parse(PlannerImpl.java:179)
> >    at herddb.sql.CalcitePlanner.runPlanner(CalcitePlanner.java:256)
> >    at herddb.sql.CalcitePlanner.translate(CalcitePlanner.java:234)
> >    ... 27 more
> > Caused by: org.apache.calcite.sql.parser.impl.ParseException: Encountered
> > ", value" at line 1, column 37.
> > Was expecting one of:
> >    ")" ...
> >    "CHARACTER" ...
> >    "CHAR" ...
> >    "VARCHAR" ...
> >    "DATE" ...
> >    "TIME" ...
> >    "TIMESTAMP" ...
> >    "DECIMAL" ...
> >    "DEC" ...
> >    "NUMERIC" ...
> >    "BOOLEAN" ...
> >    "INTEGER" ...
> >    "INT" ...
> >    "BINARY" ...
> >    "VARBINARY" ...
> >    "TINYINT" ...
> >    "SMALLINT" ...
> >    "BIGINT" ...
> >    "REAL" ...
> >    "DOUBLE" ...
> >    "FLOAT" ...
> >    "ANY" ...
> >    "MULTISET" ...
> >    <IDENTIFIER> ...
> >    <QUOTED_IDENTIFIER> ...
> >    <BACK_QUOTED_IDENTIFIER> ...
> >    <BRACKET_QUOTED_IDENTIFIER> ...
> >    <UNICODE_QUOTED_IDENTIFIER> ...
> >    "." ...
> >    "," <IDENTIFIER> ...
> >    "," <QUOTED_IDENTIFIER> ...
> >    "," <BACK_QUOTED_IDENTIFIER> ...
> >    "," <BRACKET_QUOTED_IDENTIFIER> ...
> >    "," <UNICODE_QUOTED_IDENTIFIER> ...
> >
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:22557)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:22374)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.ParenthesizedCompoundIdentifierList(SqlParserImpl.java:4436)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlInsert(SqlParserImpl.java:1147)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:792)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:814)
> >    at
> >
> org.apache.calcite.sql.parser.impl.SqlParserImpl.parseSqlStmtEof(SqlParserImpl.java:187)
> >    at
> > org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:131)
> >    ... 31 more
>
> --


-- Enrico Olivelli

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message