soumyakanti3578 commented on pull request #2777:
URL: https://github.com/apache/hive/pull/2777#issuecomment-982153696
@kasakrisz
I tried adding a primary key constraint to the suggested table
in`quotedid_basic.q`, however, I am getting an error:
` org.apache.hadoop.hive.ql.metadata.HiveException:
InvalidObjectException(message:Parent column not found:
"%&'()*+,-/;<=>?[]_|{}$^!~#@``)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1298)
at
org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.createTableNonReplaceMode(CreateTableOperation.java:136)
at
org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.execute(CreateTableOperation.java:98)
at org.apache.hadoop.hive.ql.ddl.DDLTask.execute(DDLTask.java:84)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:212)
at
org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105)
at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:361)
at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:334)
at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:245)
at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:108)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:348)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:204)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:153)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:148)
at
org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:164)
at
org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:230)
at
org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:256)
at org.apache.hadoop.hive.cli.CliDriver.processCmd1(CliDriver.java:201)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:127)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:422)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:353)
at
org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:726)
at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:696)
at
org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:114)
at
org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:157)
at
org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver(TestMiniLlapLocalCliDriver.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)`
This error is due to mismatch of the column names. In the `addPrimaryKey`
method
[here](https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L5724),
`columnName` gets trimmed in `normalizeIdentifier` and loses the ` `(space),
and it doesn't match with the column name from the ColumnDescriptor in
`getColumnIndexFromTableColumns` method
[here](https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L5735).
And this happens because we don't call `normalizeIdentifier` on the column
name while converting `FieldSchema` to `MFieldSchema` in
`convertToMFieldSchemas` method
[here](https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L2297)
. I tried adding `normalizeIdentifier` there but it fails elsewhere, and
anyway I d
on't think its the correct solution because we don't want to trim the quoted
identifier.
What do you think about this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]