You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Sunil Kumar (JIRA)" <ji...@apache.org> on 2010/05/17 13:53:44 UTC
[jira] Created: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
------------------------------------------------------------------------------------------------------
Key: HIVE-1346
URL: https://issues.apache.org/jira/browse/HIVE-1346
Project: Hadoop Hive
Issue Type: Bug
Components: Clients
Affects Versions: 0.5.0
Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
Reporter: Sunil Kumar
Priority: Minor
when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
String tableName = "user";
String sql = "select * from " + tableName + " where id=1";
result = stmt.executeQuery(sql);
ResultSetMetaData metaData = result.getMetaData();
int columnCount = metaData.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
System.out.println("Column name: " + metaData.getColumnName(i));
}
executing above code i got following result:-
Column name:_col1
Column name:_col2
while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sunil Kumar updated HIVE-1346:
------------------------------
Attachment: HIVE-1346_patch.patch
I have updated code in the org.apache.hadoop.hive.ql.parse.SemanticAnalyzer java file for both server side and client side.
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Namit Jain updated HIVE-1346:
-----------------------------
Status: Open (was: Patch Available)
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868195#action_12868195 ]
Sunil Kumar commented on HIVE-1346:
-----------------------------------
To solve this issuse need to apply this patch HIVE-1346_patch.patch and updated hive-exec-0.5.0.jar in both server side and client side
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sunil Kumar updated HIVE-1346:
------------------------------
Status: Patch Available (was: Open)
Patch updated
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12871299#action_12871299 ]
Namit Jain commented on HIVE-1346:
----------------------------------
The patch does not apply cleanly - can you regenerate the patch ?
Make sure that you do from $HIVE_TRUNK, and not $HIVE_TRUNK/ql
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870995#action_12870995 ]
Sunil Kumar commented on HIVE-1346:
-----------------------------------
Hi Namit,
Sure I will change and upload the new patch.
Thanks and Regards.
Sunil Kumar
Extn- 2657
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Ashish Thusoo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872968#action_12872968 ]
Ashish Thusoo commented on HIVE-1346:
-------------------------------------
Hi Sunil,
Have you created this patch on 0.5.0 branch or trunk? Are you proposing that this goes into both 0.5.1 and trunk?
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Assignee: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Namit Jain updated HIVE-1346:
-----------------------------
Status: Open (was: Patch Available)
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872984#action_12872984 ]
Sunil Kumar commented on HIVE-1346:
-----------------------------------
Hi Ashish,
I have created patch on http://svn.apache.org/repos/asf/hadoop/hive/tags/release-0.5.0
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Assignee: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sunil Kumar updated HIVE-1346:
------------------------------
Attachment: HIVE-1346_patch.patch
updated
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Ashish Thusoo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872975#action_12872975 ]
Ashish Thusoo commented on HIVE-1346:
-------------------------------------
@Namit,
in what cases would colAlias ever be null. There seems to be code which checks for this around line 3314 in the trunk branch. But afaik we should always be generating a colAlias (at least the default ones). Just wanted to make sure that we are covering all the basis with this fix.
Ashish
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Assignee: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870855#action_12870855 ]
Namit Jain commented on HIVE-1346:
----------------------------------
The change looks good - can you change the comment to remove your name from it.
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872901#action_12872901 ]
Sunil Kumar commented on HIVE-1346:
-----------------------------------
Hi Namit,
Patch HIVE-1346_patch.patch ,2010-05-26 01:48 AM is now created from $HIVE_TRUNK
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sunil Kumar updated HIVE-1346:
------------------------------
Attachment: HIVE-1346_patch.patch
Updated patch name removed from comment section
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Ashish Thusoo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashish Thusoo reassigned HIVE-1346:
-----------------------------------
Assignee: Sunil Kumar
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Assignee: Sunil Kumar
> Priority: Minor
> Attachments: HIVE-1346_patch.patch, HIVE-1346_patch.patch, HIVE-1346_patch.patch
>
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HIVE-1346) Table column name changed to
_col1,_col2 ..._coln when where clause used in the select quert statement
Posted by "Sunil Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sunil Kumar updated HIVE-1346:
------------------------------
Status: Patch Available (was: Open)
I have updated code in the org.apache.hadoop.hive.ql.parse.SemanticAnalyzer java file for both server side and client side.
> Table column name changed to _col1,_col2 ..._coln when where clause used in the select quert statement
> ------------------------------------------------------------------------------------------------------
>
> Key: HIVE-1346
> URL: https://issues.apache.org/jira/browse/HIVE-1346
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 0.5.0
> Environment: ubuntu8.04, jdk-6,hive-0.5.0, hadoop-0.20.1
> Reporter: Sunil Kumar
> Priority: Minor
>
> when where clause used in the hive query hive -ResultSetMetaData does not give original table column name. While when where clause not used ResultSetMetaData gives original table column names. I have used following code:-
> String tableName = "user";
> String sql = "select * from " + tableName + " where id=1";
> result = stmt.executeQuery(sql);
> ResultSetMetaData metaData = result.getMetaData();
> int columnCount = metaData.getColumnCount();
> for (int i = 1; i <= columnCount; i++) {
> System.out.println("Column name: " + metaData.getColumnName(i));
> }
> executing above code i got following result:-
> Column name:_col1
> Column name:_col2
> while original user table columns names were (id,name).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.