Hi,

I re-try my use-case on Apache Hive 4.0.0-beta-1 release. ??Just with create 
table statement.??
This behavior still exists.


Best regards,


Chang
------------------ ???????? ------------------
??????:                                                                         
                                               "user"                           
                                                         <zabe...@gmail.com&gt;;
????????:&nbsp;2024??2??1??(??????) ????4:21
??????:&nbsp;"user"<user@hive.apache.org&gt;;"hang.wd"<hang...@foxmail.com&gt;;

????:&nbsp;Re: [Hive Support] Query about StandardStructObjectInspector 
converting field names to lowercase



Hi Chang,

The hive-hcatalog-core-1.1.0-cdh5.13.1.jar jar file is not something
maintained by Apache. For vendor specific problems you should reach
out to the respective support team from where you obtained the
product.

Apart from that the version that you are using (5.13.1) is quite old.
Please re-try your use-case with the latest Apache Hive 4.0.0-beta-1
release [1] and report back if you still observe unexpected behavior.

Best,
Stamatis

[1] https://hive.apache.org/general/downloads/

On Mon, Jan 29, 2024 at 5:52?6?2AM chang.wd <chang...@foxmail.com&gt; wrote:
&gt;
&gt; Dear Hive Support Team,
&gt;
&gt; I hope you are doing well. I am writing to inquire about a specific 
behavior I encountered in Hive, related to the 
org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector 
class.
&gt;
&gt; Sql to reply this behavior:
&gt; ```
&gt; -- add JsonSerDe jar
&gt; ADD JAR hive-hcatalog-core-1.1.0-cdh5.13.1.jar;
&gt; -- create json table, the `struct<MD5:string&gt;` will become to lower 
case: `struct<md5:string&gt;`.
&gt; CREATE TABLE `test.hive_json_struct_schema`(
&gt; &nbsp; `cond_keys` struct<MD5:string&gt;
&gt; )
&gt; ROW FORMAT SERDE
&gt; &nbsp; 'org.apache.hive.hcatalog.data.JsonSerDe'
&gt; STORED AS INPUTFORMAT
&gt; &nbsp; 'org.apache.hadoop.mapred.TextInputFormat'
&gt; OUTPUTFORMAT
&gt; &nbsp; 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
&gt; ```
&gt;
&gt; When using the StandardStructObjectInspector class, it appears that field 
names are being automatically converted to lowercase in the following code 
snippet:
&gt;
&gt; ```
&gt; this.fieldName = fieldName.toLowerCase();
&gt; ```
&gt;
&gt; This behavior subsequently causes issues when querying JSON formatted 
tables, particularly when nested Struct field names within the JSON data 
contain a mix of uppercase and lowercase characters. Since field names are 
being changed to lowercase by the StandardStructObjectInspector class, the 
actual field names no longer match the expected field names, which leads to 
errors when reading the data.(Not with SQL)
&gt;
&gt; I would appreciate if you could kindly provide an explanation for this 
design choice and whether there are any available workarounds or alternative 
solutions for this scenario. I understand that the class may have been 
implemented to avoid case sensitivity issues, but in cases like mine where 
field name case matters, it would be helpful to have a better understanding of 
how to handle this situation.
&gt;
&gt; Thank you in advance for your assistance and guidance. I look forward to 
hearing from you.
&gt;
&gt; Best regards,
&gt;
&gt; Chang

Reply via email to