Dayakar M created HIVE-29329:
--------------------------------

             Summary: Negative value in DEFAULT constraint throwing 
ParseException.
                 Key: HIVE-29329
                 URL: https://issues.apache.org/jira/browse/HIVE-29329
             Project: Hive
          Issue Type: Bug
          Components: HiveServer2
            Reporter: Dayakar M
            Assignee: Dayakar M


Negative value in DEFAULT constraint throwing ParseException.

Steps to reproduce:
{noformat}
CREATE TABLE tab_default(c0 boolean, c1 int DEFAULT -15);{noformat}
Exception thrown:
{noformat}
ParseException line 47:52 cannot recognize input near '-' '15' ')' in column 
constraint
org.apache.hadoop.hive.ql.parse.ParseException: line 47:52 cannot recognize 
input near '-' '15' ')' in column constraint
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:125)
    at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:101)
    at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93)
    at org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:177)
    at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:107)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:498)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:450)
    at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:414)
    at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:408)
    at 
org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:126)
    at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:234)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd1(CliDriver.java:203)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:129)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:430)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:358)
    at 
org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:760)
    at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:730)
    at 
org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:115)
    at 
org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:139)
    at 
org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver(TestMiniLlapLocalCliDriver.java:62)
    at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at 
org.apache.hadoop.hive.cli.control.CliAdapter$2$1.evaluate(CliAdapter.java:118)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at 
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at 
org.apache.hadoop.hive.cli.control.CliAdapter$1$1.evaluate(CliAdapter.java:89)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
    at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
    at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
    at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
    at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
    at 
org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
    at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: NoViableAltException(424@[])
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.defaultVal(HiveParser.java:33373)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.columnConstraintType(HiveParser.java:32857)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.colConstraint(HiveParser.java:32649)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.columnConstraint(HiveParser.java:32338)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.columnNameTypeConstraint(HiveParser.java:32093)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.columnNameTypeOrConstraint(HiveParser.java:31831)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.columnNameTypeOrConstraintList(HiveParser.java:27269)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser_CreateDDLParser.createTableStatement(HiveParser_CreateDDLParser.java:1679)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.createTableStatement(HiveParser.java:43717)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:3699)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:2880)
    at 
org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1661)
    at 
org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:123){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to