kasakrisz commented on a change in pull request #2777:
URL: https://github.com/apache/hive/pull/2777#discussion_r760859466
##########
File path:
ql/src/test/results/clientpositive/llap/show_create_table_db_table.q.out
##########
@@ -120,8 +120,8 @@ POSTHOOK: query: SHOW CREATE TABLE tmp_feng.tmp_showcrt4
POSTHOOK: type: SHOW_CREATETABLE
POSTHOOK: Input: tmp_feng@tmp_showcrt4
CREATE TABLE `tmp_feng`.`tmp_showcrt4`(
- `s1` struct<`p1`:string>,
- `s2` struct<`p2`:array<map<int,uniontype<struct<`a`:int, `b`:string>,
array<struct<`c`:int, `d`:string>>>>>>)
+ `s1` struct<``p1``:string>,
+ `s2` struct<``p2``:array<map<int,uniontype<struct<``a``:int, ``b``:string>,
array<struct<``c``:int, ``d``:string>>>>>>)
Review comment:
I tried to run this generated create table statement from q test but it
failed.
The reason is that some struct fields names are escaped twice:
```
structElementName = HiveUtils.unparseIdentifier(structElementName,
Hive.get().getConf()); // <- first
String structElementType =
formatType(structTypeInfo.getAllStructFieldTypeInfos().get(i));
structFormattedType.append("`" + structElementName + "`:" +
structElementType); // <- second
```
I also did some testing with struct fields having space and other special
characters in their names. Unfortunately this is not supported so we can not
create such tables.
I think the line
```
structElementName = HiveUtils.unparseIdentifier(structElementName,
Hive.get().getConf());
```
should be reverted for now.
--
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]