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

Naveen Gangam commented on HIVE-16974:
--------------------------------------

Thanks for the suggestion [~aihuaxu]. I have tested out the fix with {{order by 
NAME, ID}}.
We are back to the problem we started with, which is having nulls first on 
certain DBs vs Nulls last on certain DBs.
on mysql
{code}
SD_ID in TBLS should not be NULL for Table Name=null, Table ID=101, Table 
Type=EXTERNAL_TABLE
SD_ID in TBLS should not be NULL for Table Name=table1, Table ID=100, Table 
Type=MANAGED_TABLE
SD_ID in TBLS should not be NULL for Table Name=table2, Table ID=106, Table 
Type=EXTERNAL_TABLE
SD_ID in TBLS should not be NULL for Table Name=table3, Table ID=102, Table 
Type=MANAGED_TABLE
SD_ID in TBLS should not be NULL for Table Name=table3, Table ID=107, Table 
Type=MANAGED_TABLE
{code}
or others
{code}
SD_ID in TBLS should not be NULL for Table Name=table1, Table ID=100, Table 
Type=MANAGED_TABLE
SD_ID in TBLS should not be NULL for Table Name=table2, Table ID=106, Table 
Type=EXTERNAL_TABLE
SD_ID in TBLS should not be NULL for Table Name=table3, Table ID=102, Table 
Type=MANAGED_TABLE
SD_ID in TBLS should not be NULL for Table Name=table3, Table ID=107, Table 
Type=MANAGED_TABLE
SD_ID in TBLS should not be NULL for Table Name=null, Table ID=101, Table 
Type=EXTERNAL_TABLE
{code}

The other option is to change the ordering to {{order by ID, NAME}} which is 
pretty similar to the output with just {{order by ID}} for search purposes. 

In both cases, we still print out the NAME value of the entity so I do not 
think it is much of a value add to add the second column for ordering.

Hope this helps. Thanks

> Change the sort key for the schema tool validator to be <ID>
> ------------------------------------------------------------
>
>                 Key: HIVE-16974
>                 URL: https://issues.apache.org/jira/browse/HIVE-16974
>             Project: Hive
>          Issue Type: Sub-task
>          Components: HiveServer2
>    Affects Versions: 3.0.0
>            Reporter: Naveen Gangam
>            Assignee: Naveen Gangam
>         Attachments: HIVE-16974.patch, HIVE-16974.patch
>
>
> In HIVE-16729, we introduced ordering of results/failures returned by 
> schematool's validators. This allows fault injection testing to expect 
> results that can be verified. However, they were sorted on NAME values which 
> in the HMS schema can be NULL. So if the introduced fault has a NULL/BLANK 
> name column value, the result could be different depending on the backend 
> database(if they sort NULLs first or last).
> So I think it is better to sort on a non-null column value.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to