[
https://issues.apache.org/jira/browse/HIVE-21270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770987#comment-16770987
]
Shubham Chaurasia commented on HIVE-21270:
------------------------------------------
Say the table is:
{code:java}
create table t3(c1 int, c2 float, c3 double, c4 string, c5 date, c6
array<int>, c7 struct<a:int,b:string>, c8 map<int,int>);{code}
And we pass some wrong query to get_sql_schema(here selecting some non existing
column) like:
{code:java}
select get_sql_schema("select non_existing from t3");{code}
It raises following exception:
{code:java}
Error: java.io.IOException: org.apache.hadoop.hive.ql.parse.SemanticException:
Line 1:7 Invalid table alias or column reference 'non_existing': (possible
column names are: c1, c2, c3, c4, c5, c6, c7, c8) (state=,code=0){code}
> A UDTF to show schema (column names and types) of given query
> -------------------------------------------------------------
>
> Key: HIVE-21270
> URL: https://issues.apache.org/jira/browse/HIVE-21270
> Project: Hive
> Issue Type: New Feature
> Components: UDF
> Affects Versions: 4.0.0
> Reporter: Shubham Chaurasia
> Assignee: Shubham Chaurasia
> Priority: Major
> Labels: pull-request-available
> Attachments: HIVE-21270.1.patch, HIVE-21270.2.patch,
> HIVE-21270.3.patch, HIVE-21270.4.patch, HIVE-21270.5.patch,
> HIVE-21270.6.patch, HIVE-21270.7.patch
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> We can get ResultSet metadata using \{{ResultSet#getMetaData()}} but JDBC
> provides no way of getting nested data types(of columns) associated with it.
> This UDTF helps to retrieve each column name and it's data type.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)