You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/08/29 15:49:43 UTC

[GitHub] [incubator-pinot] KKcorps opened a new pull request #5946: Return datatypes along with column names

KKcorps opened a new pull request #5946:
URL: https://github.com/apache/incubator-pinot/pull/5946


   Currently, JDBC connector doesn't return data types along with the column names in the Result Metadata.
   This causes issues in certain integrations such as Tableau.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] KKcorps merged pull request #5946: Return datatypes along with column names

Posted by GitBox <gi...@apache.org>.
KKcorps merged pull request #5946:
URL: https://github.com/apache/incubator-pinot/pull/5946


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5946: Return datatypes along with column names

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on a change in pull request #5946:
URL: https://github.com/apache/incubator-pinot/pull/5946#discussion_r479807244



##########
File path: pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
##########
@@ -149,6 +149,18 @@ public void testFindColumn()
     }
   }
 
+  @Test
+  public void testGetResultMetadata() throws Exception {
+    ResultSetGroup resultSetGroup = getResultSet(TEST_RESULT_SET_RESOURCE);
+    ResultSet resultSet = resultSetGroup.getResultSet(0);
+    PinotResultSet pinotResultSet = new PinotResultSet(resultSet);
+    ResultSetMetaData pinotResultSetMetadata = pinotResultSet.getMetaData();
+
+    for (int i = 0; i < resultSet.getColumnCount(); i++) {
+      Assert.assertEquals(pinotResultSetMetadata.getColumnTypeName(i+1), resultSet.getColumnDataType(i));

Review comment:
       nit: `i + 1`

##########
File path: pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/PinotResultSet.java
##########
@@ -62,6 +62,7 @@ public PinotResultSet(org.apache.pinot.client.ResultSet resultSet) {
     _closed = false;
     for (int i = 0; i < _totalColumns; i++) {
       _columns.put(_resultSet.getColumnName(i), i + 1);
+      _columnDataTypes.put(i+1, _resultSet.getColumnDataType(i));

Review comment:
       nit(formatting): `i + 1`
   

##########
File path: pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/utils/Constants.java
##########
@@ -33,7 +33,7 @@
   public static final String[] SCHEMA_COLUMNS_DTYPES = {"STRING", "STRING"};
 
   public static final String[] TABLE_COLUMNS = {"TABLE_SCHEM", "TABLE_CATALOG", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"};
-  public static final String[] TABLE_COLUMNS_DTYPES = {"STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING"};
+  public static final String[] TABLE_COLUMNS_DTYPES = {"STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING","STRING"};

Review comment:
       nit: space between comma and `"STRING"`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] KKcorps commented on a change in pull request #5946: Return datatypes along with column names

Posted by GitBox <gi...@apache.org>.
KKcorps commented on a change in pull request #5946:
URL: https://github.com/apache/incubator-pinot/pull/5946#discussion_r484567010



##########
File path: pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/PinotResultSet.java
##########
@@ -62,6 +62,7 @@ public PinotResultSet(org.apache.pinot.client.ResultSet resultSet) {
     _closed = false;
     for (int i = 0; i < _totalColumns; i++) {
       _columns.put(_resultSet.getColumnName(i), i + 1);
+      _columnDataTypes.put(i+1, _resultSet.getColumnDataType(i));

Review comment:
       done

##########
File path: pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
##########
@@ -149,6 +149,18 @@ public void testFindColumn()
     }
   }
 
+  @Test
+  public void testGetResultMetadata() throws Exception {
+    ResultSetGroup resultSetGroup = getResultSet(TEST_RESULT_SET_RESOURCE);
+    ResultSet resultSet = resultSetGroup.getResultSet(0);
+    PinotResultSet pinotResultSet = new PinotResultSet(resultSet);
+    ResultSetMetaData pinotResultSetMetadata = pinotResultSet.getMetaData();
+
+    for (int i = 0; i < resultSet.getColumnCount(); i++) {
+      Assert.assertEquals(pinotResultSetMetadata.getColumnTypeName(i+1), resultSet.getColumnDataType(i));

Review comment:
       done

##########
File path: pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/utils/Constants.java
##########
@@ -33,7 +33,7 @@
   public static final String[] SCHEMA_COLUMNS_DTYPES = {"STRING", "STRING"};
 
   public static final String[] TABLE_COLUMNS = {"TABLE_SCHEM", "TABLE_CATALOG", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"};
-  public static final String[] TABLE_COLUMNS_DTYPES = {"STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING"};
+  public static final String[] TABLE_COLUMNS_DTYPES = {"STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING", "STRING","STRING","STRING"};

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org