[ 
https://issues.apache.org/jira/browse/HIVE-4703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689945#comment-13689945
 ] 

Eugene Koifman commented on HIVE-4703:
--------------------------------------

When table is create like so:
curl -i -X PUT -HContent-type:application/json \
   -d '{ "comment":"test comment", "columns": [ { "name": "int", "type": 
"string", "comment":"1st column comment" }, {"name":"int2", "type":"int"} ], 
"format": { "storedAs": "rcfile" } }' \
    
'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table?user.name=ekoifman'

and then 'desc test_table' from Hive CLI the output looks like:
hive> desc test_table;
OK
int                     string                  from deserializer   
int2                    int                     from deserializer   
Time taken: 0.099 seconds, Fetched: 2 row(s)

or curl -i -X GET 
'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table?user.name=ekoifman'

ql.exec.DDLTask.describeTable() calls 
ql.metadata.Table.getCols()
 getCols() has access to a StorageDescriptor instance which as the correct 
column Comments but it's not
using it.  Instead it branches to use 
Hive.getFieldsFromDeserializer(getTableName(), getDeserializer())

It looks like metastore.MetaStoreUtil.determineFieldComment() produces "from 
deserializer" message.

Also, there are dozens of .q.out and other test files are written to expect 
"from deserializer" message.

So I'm not sure how WebHcat e2e tests worked before as written.
See for example, tests 4 & 8  in REST_DDL_TABLE_BASIC group in 
hcatalog/src/test/e2e/templeton/tests/ddl.conf

                
> WebHcat looses column comments and returns 'from deserializer'
> --------------------------------------------------------------
>
>                 Key: HIVE-4703
>                 URL: https://issues.apache.org/jira/browse/HIVE-4703
>             Project: Hive
>          Issue Type: Bug
>          Components: HCatalog
>    Affects Versions: 0.12.0
>            Reporter: Eugene Koifman
>            Assignee: Eugene Koifman
>             Fix For: 0.12.0
>
>         Attachments: webhcatMini.sh
>
>
> This causes Templeton e2e tests to fail.
> start WeHcat server (build/dist/hcatalog/sbin/webhcat_server.sh start)
> run commands in the attached webhcatMini.sh.
> It creates a table with some comments on columns.
> When executing describe (GET) on this table, original comments are lost and 
> are replaced with "from deserializer" string.
> Here is the output of these commands:
> localhost:dev ekoifman$ webhcatMini.sh
> Running delete test_table ifExists
> HTTP/1.1 200 OK
> Set-Cookie: 
> hadoop.auth="u=ekoifman&p=ekoifman&t=simple&e=1370945567179&s=vIBKhGQwzs5pPAY3IkhyPpDkWrY=";Version=1;Path=/;Discard
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-Type: application/json
> Transfer-Encoding: chunked
> Server: Jetty(7.6.0.v20120127)
> {"table":"test_table","database":"default"}
> Running create test_table
> HTTP/1.1 200 OK
> Set-Cookie: 
> hadoop.auth="u=ekoifman&p=ekoifman&t=simple&e=1370945569788&s=g37NbyyRnf667IciUiIpIQNYGOo=";Version=1;Path=/;Discard
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-Type: application/json
> Transfer-Encoding: chunked
> Server: Jetty(7.6.0.v20120127)
> {"table":"test_table","database":"default"}
> Running describe test_table
> HTTP/1.1 200 OK
> Set-Cookie: 
> hadoop.auth="u=ekoifman&p=ekoifman&t=simple&e=1370945572423&s=7kE1FOn1Co2JQzZfW0V1myqulw0=";Version=1;Path=/;Discard
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-Type: application/json
> Transfer-Encoding: chunked
> Server: Jetty(7.6.0.v20120127)
> {"columns":[{"name":"int","comment":"from 
> deserializer","type":"string"},{"name":"int2","comment":"from 
> deserializer","type":"int"}],"database":"default","table":"test_table"}
> Mon Jun 10 17:12:55 PDT 2013

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to