You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by me...@apache.org on 2015/07/31 05:16:43 UTC
[1/3] drill git commit: DRILL-3151: Fix many ResultSetMetaData method
return values.
Repository: drill
Updated Branches:
refs/heads/master 9932246ce -> 808350824
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetMetaDataTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetMetaDataTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetMetaDataTest.java
new file mode 100644
index 0000000..ba5435f
--- /dev/null
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetMetaDataTest.java
@@ -0,0 +1,1107 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.jdbc;
+
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.hamcrest.CoreMatchers.*;
+
+import org.apache.drill.jdbc.Driver;
+import org.apache.drill.jdbc.test.JdbcAssert;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.SQLException;
+import java.sql.Types;
+
+
+/**
+ * Test class for Drill's java.sql.ResultSetMetaData implementation.
+ * <p>
+ * Based on JDBC 4.1 (Java 7).
+ * </p>
+ */
+public class ResultSetMetaDataTest extends JdbcTestBase {
+
+ private static final String VIEW_SCHEMA = "dfs_test.tmp";
+ private static final String VIEW_NAME =
+ ResultSetMetaDataTest.class.getSimpleName() + "_View";
+
+ /** The one shared JDBC connection to Drill. */
+ private static Connection connection;
+
+ // Result set with test columns of various types. Is positioned at first row
+ // for, and must not be modified by, test methods.
+ private static ResultSet viewRow;
+
+ // Metadata for result set.
+ private static ResultSetMetaData rowMetadata;
+
+ //////////
+ // For columns in temporary test view (types accessible via casting):
+
+ // (Dynamic to make it simpler to add or remove columns.)
+ private static int columnCount;
+
+ private static int ordOptBOOLEAN;
+ private static int ordReqBOOLEAN;
+
+ private static int ordReqSMALLINT;
+ private static int ordReqINTEGER;
+ private static int ordReqBIGINT;
+
+ private static int ordReqREAL;
+ private static int ordReqFLOAT;
+ private static int ordReqDOUBLE;
+
+ private static int ordReqDECIMAL_5_3;
+ // No NUMERIC while Drill just maps it to DECIMAL.
+
+ private static int ordReqVARCHAR_10;
+ private static int ordOptVARCHAR;
+ private static int ordReqCHAR_5;
+ // No NCHAR, etc., in Drill (?).
+ private static int ordOptVARBINARY_16;
+ private static int ordOptBINARY_1048576;
+
+ private static int ordReqDATE;
+ private static int ordReqTIME_2;
+ private static int ordOptTIME_7;
+ private static int ordReqTIMESTAMP_4;
+ // No "... WITH TIME ZONE" in Drill.
+
+ private static int ordReqINTERVAL_Y;
+ private static int ordReqINTERVAL_3Y_Mo;
+ private static int ordReqINTERVAL_10Y_Mo;
+ private static int ordReqINTERVAL_Mo;
+ private static int ordReqINTERVAL_D;
+ private static int ordReqINTERVAL_4D_H;
+ private static int ordReqINTERVAL_3D_Mi;
+ private static int ordReqINTERVAL_2D_S5;
+ private static int ordReqINTERVAL_H;
+ private static int ordReqINTERVAL_1H_Mi;
+ private static int ordReqINTERVAL_3H_S1;
+ private static int ordReqINTERVAL_Mi;
+ private static int ordReqINTERVAL_5Mi_S;
+ private static int ordReqINTERVAL_S;
+ private static int ordReqINTERVAL_3S;
+ private static int ordReqINTERVAL_3S1;
+
+
+ @BeforeClass
+ public static void setUpConnectionAndMetadataToCheck() throws Exception {
+
+ // Get JDBC connection to Drill:
+ // (Note: Can't use JdbcTest's connect(...) because JdbcTest closes
+ // Connection--and other JDBC objects--on test method failure, but this test
+ // class uses some objects across methods.)
+ connection = new Driver().connect( "jdbc:drill:zk=local",
+ JdbcAssert.getDefaultProperties() );
+ final Statement stmt = connection.createStatement();
+
+ ResultSet util;
+
+ // Create temporary test-columns view:
+ util = stmt.executeQuery( "USE `" + VIEW_SCHEMA + "`" );
+ assertTrue( util.next() );
+ assertTrue( "Error setting schema for test: " + util.getString( 2 ),
+ util.getBoolean( 1 ) );
+
+ columnCount = 0;
+ final StringBuilder buf = new StringBuilder();
+
+ buf.append( "CREATE OR REPLACE VIEW `" + VIEW_NAME + "` AS SELECT " );
+
+ buf.append( "\n CAST( NULL AS BOOLEAN ) AS mdrOptBOOLEAN, " );
+ ordOptBOOLEAN = ++columnCount;
+ buf.append( "\n TRUE AS mdrReqBOOLEAN, " );
+ ordReqBOOLEAN = ++columnCount;
+
+ //buf.append( "\n CAST( 15 AS SMALLINT ) AS mdrOptSMALLINT, " );
+ //ordOptSMALLINT = ++columnCount;
+ buf.append( "\n CAST( 2 AS INTEGER ) AS mdrOptINTEGER, " );
+ ordReqINTEGER = ++columnCount;
+ buf.append( "\n CAST( 15 AS BIGINT ) AS mdrReqBIGINT, " );
+ ordReqBIGINT = ++columnCount;
+
+
+ // TODO(DRILL-2683): unignore when REAL is implemented:
+ //buf.append( "\n CAST( 3.1 AS REAL ) AS mdrReqREAL, " );
+ //ordReqREAL = ++columnCount;
+ buf.append( "\n CAST( 3.2 AS FLOAT ) AS mdrReqFLOAT, " );
+ ordReqFLOAT = ++columnCount;
+ buf.append( "\n CAST( 3.3 AS DOUBLE ) AS mdrReqDOUBLE, " );
+ ordReqDOUBLE = ++columnCount;
+
+ buf.append( "\n CAST( 4.4 AS DECIMAL(5,3) ) AS mdrReqDECIMAL_5_3, " );
+ ordReqDECIMAL_5_3 = ++columnCount;
+
+ buf.append( "\n CAST( 'Hi' AS VARCHAR(10) ) AS mdrReqVARCHAR_10, " );
+ ordReqVARCHAR_10 = ++columnCount;
+ buf.append( "\n CAST( NULL AS VARCHAR ) AS mdrOptVARCHAR, " );
+ ordOptVARCHAR = ++columnCount;
+ buf.append( "\n CAST( '55' AS CHAR(5) ) AS mdrReqCHAR_5, " );
+ ordReqCHAR_5 = ++columnCount;
+
+ // TODO(DRILL-3368): unignore when VARBINARY is implemented enough:
+ //buf.append( "\n CAST( NULL AS VARBINARY(16) ) AS mdrOptVARBINARY_16," );
+ //ordOptVARBINARY_16 = ++columnCount;
+ // TODO(DRILL-3368): unignore when BINARY is implemented enough:
+ //buf.append( "\n CAST( NULL AS BINARY(1048576) ) AS mdrOptBINARY_1048576, " );
+ //ordOptBINARY_1048576 = ++columnCount;
+
+ buf.append( "\n DATE '2015-01-01' AS mdrReqDATE, " );
+ ordReqDATE = ++columnCount;
+ buf.append( "\n CAST( TIME '23:59:59.123' AS TIME(2) ) AS mdrReqTIME_2, " );
+ ordReqTIME_2 = ++columnCount;
+ buf.append( "\n CAST( NULL AS TIME(7) ) AS mdrOptTIME_7, " );
+ ordOptTIME_7 = ++columnCount;
+ buf.append( "\n CAST( TIMESTAMP '2015-01-01 23:59:59.12345'"
+ + " AS TIMESTAMP(4) ) AS mdrReqTIMESTAMP_4, " );
+ ordReqTIMESTAMP_4 = ++columnCount;
+
+ buf.append( "\n INTERVAL '1' YEAR AS mdrReqINTERVAL_Y, " );
+ ordReqINTERVAL_Y = ++columnCount;
+ buf.append( "\n INTERVAL '1-2' YEAR(3) TO MONTH AS mdrReqINTERVAL_3Y_Mo, " );
+ ordReqINTERVAL_3Y_Mo = ++columnCount;
+ buf.append( "\n INTERVAL '1-2' YEAR(10) TO MONTH AS mdrReqINTERVAL_10Y_Mo, " );
+ ordReqINTERVAL_10Y_Mo = ++columnCount;
+ buf.append( "\n INTERVAL '-2' MONTH AS mdrReqINTERVAL_Mo, " );
+ ordReqINTERVAL_Mo = ++columnCount;
+ buf.append( "\n INTERVAL '3' DAY AS mdrReqINTERVAL_D, " );
+ ordReqINTERVAL_D = ++columnCount;
+ buf.append( "\n INTERVAL '3 4' DAY(4) TO HOUR AS mdrReqINTERVAL_4D_H, " );
+ ordReqINTERVAL_4D_H = ++columnCount;
+ buf.append( "\n INTERVAL '3 4:5' DAY(3) TO MINUTE AS mdrReqINTERVAL_3D_Mi, " );
+ ordReqINTERVAL_3D_Mi = ++columnCount;
+ buf.append( "\n INTERVAL '3 4:5:6' DAY(2) TO SECOND(5) AS mdrReqINTERVAL_2D_S5, " );
+ ordReqINTERVAL_2D_S5 = ++columnCount;
+ buf.append( "\n INTERVAL '4' HOUR AS mdrReqINTERVAL_H, " );
+ ordReqINTERVAL_H = ++columnCount;
+ buf.append( "\n INTERVAL '4:5' HOUR(1) TO MINUTE AS mdrReqINTERVAL_1H_Mi, " );
+ ordReqINTERVAL_1H_Mi = ++columnCount;
+ buf.append( "\n INTERVAL '4:5:6' HOUR(3) TO SECOND(1) AS mdrReqINTERVAL_3H_S1, " );
+ ordReqINTERVAL_3H_S1 = ++columnCount;
+ buf.append( "\n INTERVAL '5' MINUTE AS mdrReqINTERVAL_Mi, " );
+ ordReqINTERVAL_Mi = ++columnCount;
+ buf.append( "\n INTERVAL '5:6' MINUTE(5) TO SECOND AS mdrReqINTERVAL_5Mi_S, " );
+ ordReqINTERVAL_5Mi_S = ++columnCount;
+ buf.append( "\n INTERVAL '6' SECOND AS mdrReqINTERVAL_S, " );
+ ordReqINTERVAL_S = ++columnCount;
+ buf.append( "\n INTERVAL '6' SECOND(3) AS mdrReqINTERVAL_3S, " );
+ ordReqINTERVAL_3S = ++columnCount;
+ buf.append( "\n INTERVAL '6' SECOND(3, 1) AS mdrReqINTERVAL_3S1, " );
+ ordReqINTERVAL_3S1 = ++columnCount;
+
+ buf.append( "\n ''" );
+ ++columnCount;
+ buf.append( "\nFROM INFORMATION_SCHEMA.COLUMNS LIMIT 1 " );
+
+ final String query = buf.toString();
+ util = stmt.executeQuery( query );
+ assertTrue( util.next() );
+ assertTrue( "Error creating temporary test-columns view " + VIEW_NAME + ": "
+ + util.getString( 2 ), util.getBoolean( 1 ) );
+
+ viewRow = stmt.executeQuery( "SELECT * FROM " + VIEW_NAME + " LIMIT 1 " );
+ viewRow.next();
+
+ rowMetadata = viewRow.getMetaData();
+ }
+
+ @AfterClass
+ public static void tearDownConnection() throws SQLException {
+ final ResultSet util =
+ connection.createStatement().executeQuery( "DROP VIEW " + VIEW_NAME + "" );
+ assertTrue( util.next() );
+ assertTrue( "Error dropping temporary test-columns view " + VIEW_NAME + ": "
+ + util.getString( 2 ), util.getBoolean( 1 ) );
+ connection.close();
+ }
+
+
+ //////////////////////////////////////////////////////////////////////
+ // Tests:
+
+ ////////////////////////////////////////////////////////////
+ // getColumnCount(...):
+ // JDBC: "Returns the number of columns in this ResultSet object."
+
+ @Test
+ public void test_getColumnCount() throws SQLException {
+ assertThat( "column count",
+ rowMetadata.getColumnCount(), equalTo( columnCount ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isAutoIncrement(...):
+ // JDBC: "Indicates whether the designated column is automatically numbered."
+
+ @Test
+ public void test_isAutoIncrement_returnsFalse() throws SQLException {
+ assertThat( rowMetadata.isAutoIncrement( ordOptBOOLEAN ), equalTo( false ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isCaseSensitive(...):
+ // JDBC: "Indicates whether a column's case matters."
+ // (Presumably that refers to the column's name, not values.)
+ // Matters for what (for which operations)?
+
+ @Test
+ public void test_isCaseSensitive_nameThisNonSpecific() throws SQLException {
+ assertThat( rowMetadata.isCaseSensitive( ordOptBOOLEAN ), equalTo( false ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isSearchable(...):
+ // JDBC: "Indicates whether the designated column can be used in a where
+ // clause."
+ // (Is there any reason a column couldn't be used in a WHERE clause?)
+
+ @Test
+ public void test_isSearchable_returnsTrue() throws SQLException {
+ assertThat( rowMetadata.isSearchable( ordOptBOOLEAN ), equalTo( true ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isCurrency(...):
+ // JDBC: "Indicates whether the designated column is a cash value."
+
+ @Test
+ public void test_isCurrency_returnsFalse() throws SQLException {
+ assertThat( rowMetadata.isCurrency( ordOptBOOLEAN ), equalTo( false ) );
+ }
+
+ ////////////////////////////////////////////////////////////
+ // isNullable(...):
+ // JDBC: "Indicates the nullability of values in the designated column."
+
+ @Test
+ public void test_isNullable_forNullable() throws SQLException {
+ assertThat( rowMetadata.isNullable( ordOptBOOLEAN ),
+ equalTo( ResultSetMetaData.columnNullable) );
+ }
+
+ @Test
+ public void test_isNullable_forRequired() throws SQLException {
+ assertThat( rowMetadata.isNullable( ordReqINTEGER ),
+ equalTo( ResultSetMetaData.columnNoNulls) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isSigned(...):
+ // JDBC: "Indicates whether values in the designated column are signed numbers."
+ // (Does "signed numbers" include intervals (which are signed)?
+
+ @Test
+ public void test_isSigned_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordOptBOOLEAN ), equalTo( false ) );
+ }
+
+ @Test
+ public void test_isSigned_forINTEGER() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqINTEGER ), equalTo( true ) );
+ }
+
+ @Test
+ public void test_isSigned_forDOUBLE() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqDOUBLE ), equalTo( true ) );
+ }
+
+ @Test
+ public void test_isSigned_forDECIMAL_5_3() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqDECIMAL_5_3 ), equalTo( true ) );
+ }
+
+ @Test
+ public void test_isSigned_forVARCHAR() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqVARCHAR_10 ), equalTo( false ) );
+ }
+
+ @Test
+ @Ignore( "TODO(DRILL-3368): unignore when VARBINARY is implemented enough" )
+ public void test_isSigned_forBINARY_1048576() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordOptBINARY_1048576 ), equalTo( false ) );
+ }
+
+ @Test
+ public void test_isSigned_forDate() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqDATE ), equalTo( false ) );
+ }
+
+ @Test
+ public void test_isSigned_forTIME_2() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqTIME_2 ), equalTo( false ) );
+ }
+
+ @Test
+ public void test_isSigned_forTIMESTAMP_4() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqTIMESTAMP_4 ), equalTo( false ) );
+ }
+
+ @Test
+ public void test_isSigned_forINTERVAL_Y() throws SQLException {
+ assertThat( rowMetadata.isSigned( ordReqINTERVAL_Y ), equalTo( true ) );
+ }
+
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnDisplaySize(...):
+ // JDBC: "Indicates the designated column's normal maximum width in characters.
+ // ... the normal maximum number of characters allowed as the width of the
+ // designated column"
+ // (What exactly is the "normal maximum" number of characters?)
+
+ @Ignore( "TODO(DRILL-3355): unignore when getColumnDisplaySize(...) implemented" )
+ @Test
+ public void test_getColumnDisplaySize_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.getColumnDisplaySize( ordOptBOOLEAN ),
+ equalTo( 5 ) );
+ }
+
+ // TODO(DRILL-3355): Do more types when metadata is available.
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnLabel(...):
+ // JDBC: "Gets the designated column's suggested title for use in printouts
+ // and displays. The suggested title is usually specified by the SQL
+ // AS clause. If a SQL AS is not specified, the value returned from
+ // getColumnLabel will be the same as the value returned by the
+ // getColumnName method."
+
+ @Test
+ public void test_getColumnLabel_getsName() throws SQLException {
+ assertThat( rowMetadata.getColumnLabel( ordOptBOOLEAN ),
+ equalTo( "mdrOptBOOLEAN" ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnName(...):
+ // JDBC: "Get the designated column's name."
+
+ @Test
+ public void test_getColumnName_getsName() throws SQLException {
+ assertThat( rowMetadata.getColumnName( ordOptBOOLEAN ),
+ equalTo( "mdrOptBOOLEAN" ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getSchemaName(...):
+ // JDBC: "Get the designated column's table's schema. ... schema name
+ // or "" if not applicable"
+ // Note: Schema _name_, not schema, of course.
+ // (Are result-set tables in a schema?)
+
+ @Test
+ public void test_getSchemaName_forViewGetsName() throws SQLException {
+ assertThat( rowMetadata.getSchemaName( ordOptBOOLEAN ),
+ anyOf( equalTo( VIEW_SCHEMA ),
+ equalTo( "" ) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getPrecision(...):
+ // JDBC: "Get the designated column's specified column size.
+ // For numeric data, this is the maximum precision.
+ // For character data, this is the length in characters.
+ // For datetime datatypes, this is the length in characters of the String
+ // representation (assuming the maximum allowed precision of the
+ // fractional seconds component).
+ // For binary data, this is the length in bytes.
+ // For the ROWID datatype, this is the length in bytes.
+ // 0 is returned for data types where the column size is not applicable."
+ // TODO(DRILL-3355): Resolve:
+ // - Confirm: This seems to be the same as getColumns's COLUMN_SIZE.
+ // - Is numeric "maximum precision" in bits, in digits, or per some radix
+ // specified somewhere?
+ // - For which unmentioned types is column size applicable or not applicable?
+ // E.g., what about interval types?
+
+ @Test
+ public void test_getPrecision_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.getPrecision( ordOptBOOLEAN ), equalTo( 0 ) );
+ }
+
+ @Ignore( "TODO(DRILL-3355): unignore when getPrecision(...) implemented" )
+ @Test
+ public void test_getPrecision_forINTEGER() throws SQLException {
+ // Is it actual bits?:
+ assertThat( rowMetadata.getPrecision( ordReqINTEGER ), equalTo( 32 ) );
+ // Is it number of possible decimal digits?
+ assertThat( rowMetadata.getPrecision( ordReqINTEGER ), equalTo( 10 ) );
+ // Is it minimum guaranteed decimal digits?
+ assertThat( rowMetadata.getPrecision( ordReqINTEGER ), equalTo( 9 ) );
+ }
+
+ @Ignore( "TODO(DRILL-3355): unignore when getPrecision(...) implemented" )
+ @Test
+ public void test_getPrecision_forDOUBLE() throws SQLException {
+ // Is it actual bits?:
+ assertThat( rowMetadata.getPrecision( ordReqDOUBLE ), equalTo( 53 ) );
+ // Is it number of possible decimal digits?
+ assertThat( rowMetadata.getPrecision( ordReqINTEGER ), equalTo( 7 ) );
+ // Is it minimum guaranteed decimal digits?
+ assertThat( rowMetadata.getPrecision( ordReqDOUBLE ), equalTo( 6 ) );
+ }
+
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
+ @Test
+ public void test_getPrecision_forDECIMAL_5_3() throws SQLException {
+ assertThat( rowMetadata.getPrecision( ordReqDECIMAL_5_3 ), equalTo( 5 ) );
+ }
+
+ // TODO(DRILL-3355): Do more types when metadata is available.
+ // - Copy in tests for DatabaseMetaData.getColumns(...)'s COLUMN_SIZE (since
+ // ResultSetMetaData.getPrecision(...) seems to be defined the same.
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // getScale(...):
+ // JDBC: "Gets the designated column's number of digits to right of the
+ // decimal point. 0 is returned for data types where the scale is not
+ // applicable."
+ // (When exactly is scale not applicable? What about for TIME or INTERVAL?)
+
+ @Test
+ public void test_getScale_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.getScale( ordOptBOOLEAN ), equalTo( 0 ) );
+ }
+
+ @Test
+ public void test_getScale_forINTEGER() throws SQLException {
+ assertThat( rowMetadata.getScale( ordReqINTEGER ), equalTo( 0 ) );
+ }
+
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
+ @Test
+ public void test_getScale_forDECIMAL_5_3() throws SQLException {
+ assertThat( rowMetadata.getScale( ordReqDECIMAL_5_3 ), equalTo( 3 ) );
+ }
+
+ // TODO(DRILL-3355): Do more types when metadata is available.
+ // - especially TIME and INTERVAL cases.
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // getTableName(...):
+ // JDBC: "Gets the designated column's table name. ... table name or "" if
+ // not applicable"
+ // (When exactly is this applicable or not applicable?)
+
+ @Test
+ public void test_getTableName_forViewGetsName() throws SQLException {
+ assertThat( rowMetadata.getTableName( ordOptBOOLEAN ),
+ anyOf( equalTo( VIEW_NAME ),
+ equalTo( "" ) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getCatalogName(...):
+ // JDBC: "Gets the designated column's table's catalog name. ... the name of
+ // the catalog for the table in which the given column appears or "" if not
+ // applicable"
+ // (What if the result set is not directly from a base table? Since Drill has
+ // has only one catalog ("DRILL") should this return "DRILL" for everything,
+ // or only for base tables?)
+
+ @Test
+ public void test_getCatalogName_getsCatalogName() throws SQLException {
+ assertThat( rowMetadata.getCatalogName( ordOptBOOLEAN ),
+ anyOf( equalTo( "DRILL" ), equalTo( "" ) ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnType(...):
+ // JDBC: "Retrieves the designated column's SQL type. ... SQL type from
+ // java.sql.Types"
+ // NOTE: JDBC representation of data type or data type family.
+
+ @Test
+ public void test_getColumnType_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordOptBOOLEAN ),
+ equalTo( Types.BOOLEAN ) );
+ }
+
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
+ @Test
+ public void test_getColumnType_forSMALLINT() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqSMALLINT ),
+ equalTo( Types.SMALLINT ) );
+ }
+
+ @Test
+ public void test_getColumnType_forINTEGER() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqINTEGER ),
+ equalTo( Types.INTEGER ) );
+ }
+
+ @Test
+ public void test_getColumnType_forBIGINT() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqBIGINT ),
+ equalTo( Types.BIGINT ) );
+ }
+
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
+ @Test
+ public void test_getColumnType_forREAL() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqREAL ),
+ equalTo( Types.REAL ) );
+ }
+
+ @Test
+ public void test_getColumnType_forFLOAT() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqFLOAT ),
+ equalTo( Types.FLOAT ) );
+ }
+
+ @Test
+ public void test_getColumnType_forDOUBLE() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqDOUBLE ),
+ equalTo( Types.DOUBLE ) );
+ }
+
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
+ @Test
+ public void test_getColumnType_forDECIMAL_5_3() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqDECIMAL_5_3 ),
+ equalTo( Types.DECIMAL ) );
+ }
+
+ @Test
+ public void test_getColumnType_forVARCHAR_10() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqVARCHAR_10 ),
+ equalTo( Types.VARCHAR ) );
+ }
+
+ @Test
+ public void test_getColumnType_forVARCHAR() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordOptVARCHAR ),
+ equalTo( Types.VARCHAR ) );
+ }
+
+ @Ignore( "TODO(DRILL-3369): unignore when CHAR is no longer VARCHAR" )
+ @Test
+ public void test_getColumnType_forCHAR_5() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqCHAR_5 ),
+ equalTo( Types.CHAR ) );
+ }
+
+ @Ignore( "TODO(DRILL-3368): unignore when VARBINARY is implemented enough" )
+ @Test
+ public void test_getColumnType_forVARBINARY_16() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordOptVARBINARY_16 ),
+ equalTo( Types.VARBINARY ) );
+ }
+
+ @Ignore( "TODO(DRILL-3368): unignore when BINARY is implemented enough" )
+ @Test
+ public void test_getColumnType_forBINARY_1048576CHECK() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordOptBINARY_1048576 ),
+ equalTo( Types.VARBINARY ) );
+ }
+
+ @Test
+ public void test_getColumnType_forDATE() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqDATE ),
+ equalTo( Types.DATE ) );
+ }
+
+ @Test
+ public void test_getColumnType_forTIME_2() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqTIME_2 ),
+ equalTo( Types.TIME ) );
+ }
+
+ @Test
+ public void test_getColumnType_forTIME_7() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordOptTIME_7 ),
+ equalTo( Types.TIME ) );
+ }
+
+ @Test
+ public void test_getColumnType_forTIMESTAMP_4() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqTIMESTAMP_4 ),
+ equalTo( Types.TIMESTAMP ) );
+ }
+
+ @Test
+ public void test_getColumnType_forINTERVAL_Y() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqINTERVAL_Y ),
+ equalTo( Types.OTHER ) );
+ }
+
+ @Test
+ public void test_getColumnType_forINTERVAL_H_S3() throws SQLException {
+ assertThat( rowMetadata.getColumnType( ordReqINTERVAL_3H_S1 ),
+ equalTo( Types.OTHER ) );
+ }
+
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnTypeName(...):
+ // JDBC: "Retrieves the designated column's database-specific type name.
+ // ... type name used by the database. If the column type is a user-defined
+ // type, then a fully-qualified type name is returned."
+ // (Is this expected to match INFORMATION_SCHEMA.COLUMNS.TYPE_NAME?)
+
+ @Test
+ public void test_getColumnTypeName_forBOOLEAN() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordOptBOOLEAN ),
+ equalTo( "BOOLEAN" ) );
+ }
+
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
+ @Test
+ public void test_getColumnTypeName_forSMALLINT() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqSMALLINT ),
+ equalTo( "SMALLINT" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forINTEGER() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqINTEGER ),
+ equalTo( "INTEGER" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forBIGINT() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqBIGINT ),
+ equalTo( "BIGINT" ) );
+ }
+
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
+ @Test
+ public void test_getColumnTypeName_forREAL() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqREAL ),
+ equalTo( "REAL" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forFLOAT() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqFLOAT ),
+ equalTo( "FLOAT" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forDOUBLE() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqDOUBLE ),
+ equalTo( "DOUBLE" ) );
+ }
+
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
+ @Test
+ public void test_getColumnTypeName_forDECIMAL_5_3() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqDECIMAL_5_3 ),
+ equalTo( "DECIMAL" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forVARCHAR() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordOptVARCHAR ),
+ equalTo( "CHARACTER VARYING" ) );
+ }
+
+ @Ignore( "TODO(DRILL-3369): unignore when CHAR is no longer VARCHAR" )
+ @Test
+ public void test_getColumnTypeName_forCHAR() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqCHAR_5 ),
+ equalTo( "CHARACTER" ) );
+ }
+
+ @Ignore( "TODO(DRILL-3368): unignore when VARBINARY is implemented enough" )
+ @Test
+ public void test_getColumnTypeName_forVARBINARY() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordOptVARBINARY_16 ),
+ equalTo( "BINARY VARYING" ) );
+ }
+
+ @Ignore( "TODO(DRILL-3368): unignore when BINARY is implemented enough" )
+ @Test
+ public void test_getColumnTypeName_forBINARY() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordOptBINARY_1048576 ),
+ equalTo( "BINARY" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forDATE() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqDATE ),
+ equalTo( "DATE" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forTIME_2() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqTIME_2 ),
+ equalTo( "TIME" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forTIMESTAMP_4() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqTIMESTAMP_4 ),
+ equalTo( "TIMESTAMP" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forINTERVAL_Y() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqINTERVAL_Y ),
+ equalTo( "INTERVAL" ) );
+ }
+
+ @Test
+ public void test_getColumnTypeName_forINTERVAL_D() throws SQLException {
+ assertThat( rowMetadata.getColumnTypeName( ordReqINTERVAL_4D_H ),
+ equalTo( "INTERVAL" ) );
+ }
+
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+ ////////////////////////////////////////////////////////////
+ // isReadOnly(...):
+ // JDBC: "Indicates whether the designated column is definitely not writable."
+ // (Writable in what context? By current user in current connection? Some
+ // other context?)
+
+ @Test
+ public void test_isReadOnly_nameThisNonSpecific() throws SQLException {
+ assertThat( rowMetadata.isReadOnly( ordOptBOOLEAN ), equalTo( true ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isWritable(...):
+ // JDBC: "Indicates whether it is possible for a write on the designated
+ // column to succeed."
+ // (Possible in what context? By current user in current connection? Some
+ // other context?
+
+ @Test
+ public void test_isWritable_nameThisNonSpecific() throws SQLException {
+ assertThat( rowMetadata.isWritable( ordOptBOOLEAN ), equalTo( false ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // isDefinitelyWritable(...):
+ // JDBC: "Indicates whether a write on the designated column will definitely
+ // succeed."
+ // (Will succeed in what context? By current user in current connection?
+ // Some other context?)
+
+ @Test
+ public void test_isDefinitelyWritable_nameThisNonSpecific() throws SQLException {
+ assertThat( rowMetadata.isDefinitelyWritable( ordOptBOOLEAN ),
+ equalTo( false ) );
+ }
+
+
+ ////////////////////////////////////////////////////////////
+ // getColumnClassName(...):
+ // JDBC: "Returns the fully-qualified name of the Java class whose instances
+ // are manufactured if the method ResultSet.getObject is called to retrieve
+ // a value from the column. ResultSet.getObject may return a subclass of
+ // the class returned by this method. ... the fully-qualified name of the
+ // class in the Java programming language that would be used by the method"
+
+ // BOOLEAN:
+
+ @Test
+ public void test_getColumnClassName_forBOOLEAN_isBoolean() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordOptBOOLEAN ),
+ equalTo( Boolean.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forBOOLEAN_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqBOOLEAN ),
+ // (equalTo because Boolean is final)
+ equalTo( viewRow.getObject( ordReqBOOLEAN ).getClass().getName() ) );
+ }
+
+ // SMALLINT:
+
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
+ @Test
+ public void test_getColumnClassName_forSMALLINT_isShort() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqSMALLINT ),
+ equalTo( Short.class.getName() ) );
+ }
+
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
+ @Test
+ public void test_getColumnClassName_forSMALLINT_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqSMALLINT ),
+ // (equalTo because Short is final)
+ equalTo( viewRow.getObject( ordReqSMALLINT ).getClass().getName() ) );
+ }
+
+ // INTEGER:
+
+ @Test
+ public void test_getColumnClassName_forINTEGER_isInteger() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqINTEGER ),
+ equalTo( Integer.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forINTEGER_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqINTEGER ),
+ // (equalTo because Integer is final)
+ equalTo( viewRow.getObject( ordReqINTEGER ).getClass().getName() ) );
+ }
+
+ // BIGINT:
+
+ @Test
+ public void test_getColumnClassName_forBIGINT_isLong() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqBIGINT ),
+ equalTo( Long.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forBIGINT_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqBIGINT ),
+ // (equalTo because Long is final)
+ equalTo( viewRow.getObject( ordReqBIGINT ).getClass().getName() ) );
+ }
+
+ // REAL:
+
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
+ @Test
+ public void test_getColumnClassName_forREAL_isFloat() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqREAL ),
+ equalTo( Float.class.getName() ) );
+ }
+
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
+ @Test
+ public void test_getColumnClassName_forREAL_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqREAL ),
+ // (equalTo because Float is final)
+ equalTo( viewRow.getObject( ordReqREAL ).getClass().getName() ) );
+ }
+
+ // FLOAT:
+
+ @Test
+ public void test_getColumnClassName_forFLOAT_isFloat() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqFLOAT ),
+ anyOf( equalTo( Float.class.getName() ),
+ equalTo( Double.class.getName() ) ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forFLOAT_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqFLOAT ),
+ // (equalTo because Float is final)
+ equalTo( viewRow.getObject( ordReqFLOAT ).getClass().getName() ) );
+ }
+
+ // DOUBLE:
+
+ @Test
+ public void test_getColumnClassName_forDOUBLE_isDouble() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqDOUBLE ),
+ equalTo( Double.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forDOUBLE_matches() throws SQLException {
+ assertThat(
+ rowMetadata.getColumnClassName( ordReqDOUBLE ),
+ // (equalTo because Double is final)
+ equalTo( viewRow.getObject( ordReqDOUBLE ).getClass().getName() ) );
+ }
+
+ // DECIMAL_5_3:
+
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
+ @Test
+ public void test_getColumnClassName_forDECIMAL_5_3_isBigDecimal() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqDECIMAL_5_3 ),
+ equalTo( BigDecimal.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forDECIMAL_5_3_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqDECIMAL_5_3 ) );
+ final Class<?> actualClass = viewRow.getObject( ordReqDECIMAL_5_3 ).getClass();
+ assertTrue( "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // VARCHAR_10:
+
+ @Test
+ public void test_getColumnClassName_forVARCHAR_10_isString() throws SQLException {
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
+ assertThat( rowMetadata.getColumnClassName( ordReqVARCHAR_10 ),
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forVARCHAR_10_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqVARCHAR_10 ) );
+ final Class<?> actualClass = viewRow.getObject( ordReqVARCHAR_10 ).getClass();
+ assertTrue( "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // TODO(DRILL-3369): Add test when CHAR is no longer VARCHAR:
+ // CHAR_5:
+ // TODO(DRILL-3368): Add test when VARBINARY is implemented enough:
+ // VARBINARY_16
+ // TODO(DRILL-3368): Add test when BINARY is implemented enough:
+ // BINARY_1048576:
+
+ // DATE:
+
+ @Test
+ public void test_getColumnClassName_forDATE_isDate() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqDATE ),
+ equalTo( Date.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forDATE_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqDATE ) );
+ final Class<?> actualClass = viewRow.getObject( ordReqDATE ).getClass();
+ assertTrue(
+ "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // TIME:
+
+ @Test
+ public void test_getColumnClassName_forTIME_2_isTime() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqTIME_2 ),
+ equalTo( Time.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forTIME_2_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqTIME_2 ) );
+ final Class<?> actualClass = viewRow.getObject( ordReqTIME_2 ).getClass();
+ assertTrue(
+ "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // TIME_7:
+
+ // TIMESTAMP:
+
+ @Test
+ public void test_getColumnClassName_forTIMESTAMP_4_isDate() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqTIMESTAMP_4 ),
+ equalTo( Timestamp.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forTIMESTAMP_4_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqTIMESTAMP_4 ) );
+ final Class<?> actualClass =
+ viewRow.getObject( ordReqTIMESTAMP_4 ).getClass();
+ assertTrue(
+ "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // No "... WITH TIME ZONE" in Drill.
+
+ // INTERVAL_Y:
+
+ // INTERVAL_3Y_Mo:
+
+ // INTERVAL_10Y_Mo:
+
+ @Test
+ public void test_getColumnClassName_forINTERVAL_10Y_Mo_isJodaPeriod() throws SQLException {
+ assertThat( rowMetadata.getColumnClassName( ordReqINTERVAL_10Y_Mo ),
+ equalTo( org.joda.time.Period.class.getName() ) );
+ }
+
+ @Test
+ public void test_getColumnClassName_forINTERVAL_10Y_Mo_matches()
+ throws SQLException, ClassNotFoundException {
+ final Class<?> requiredClass =
+ Class.forName( rowMetadata.getColumnClassName( ordReqINTERVAL_10Y_Mo ) );
+ final Class<?> actualClass =
+ viewRow.getObject( ordReqINTERVAL_10Y_Mo ).getClass();
+ assertTrue( "actual class " + actualClass.getName()
+ + " is not assignable to required class " + requiredClass,
+ requiredClass.isAssignableFrom( actualClass ) );
+ }
+
+ // TODO(DRILL-3253): Do more types when we have all-types test storage plugin.
+
+
+} // class DatabaseMetaGetColumnsDataTest
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessorTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessorTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessorTest.java
index a595ed4..3a4b83e 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessorTest.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessorTest.java
@@ -59,6 +59,11 @@ public class TypeConvertingSqlAccessorTest {
}
@Override
+ public Class<?> getObjectClass() {
+ throw new RuntimeException( "Unexpected use of getObjectClass(...)" );
+ }
+
+ @Override
public MajorType getType() {
return type;
}
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestInformationSchemaColumns.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestInformationSchemaColumns.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestInformationSchemaColumns.java
index 8fb521e..4e076b7 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestInformationSchemaColumns.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestInformationSchemaColumns.java
@@ -40,7 +40,7 @@ import static java.sql.ResultSetMetaData.columnNullable;
import java.sql.SQLException;
import java.sql.Types;
-// NOTE: TempInformationSchemaColumnsTest and DatabaseMetaDataGetColumnsTest
+// NOTE: TestInformationSchemaColumns and DatabaseMetaDataGetColumnsTest
// have identical sections. (Cross-maintain them for now; factor out later.)
// TODO: Review nullability (NULLABLE and IS_NULLABLE columns):
@@ -208,7 +208,9 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertTrue( util.next() );
assertTrue( "Error setting schema for test: " + util.getString( 2 ), util.getBoolean( 1 ) );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2470): Adjust when TINYINT is implemented:
+ // TODO(DRILL-2470): Adjust when SMALLINT is implemented:
+ // TODO(DRILL-2683): Adjust when REAL is implemented:
util = stmt.executeQuery(
""
+ "CREATE OR REPLACE VIEW " + VIEW_NAME + " AS SELECT "
@@ -265,13 +267,14 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
mdrOptBOOLEAN = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptBOOLEAN" );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2470): Uncomment when TINYINT is implemented:
//mdrReqTINYINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqTINYINT" );
+ // TODO(DRILL-2470): Uncomment when SMALLINT is implemented:
//mdrOptSMALLINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptSMALLINT" );
mdrReqINTEGER = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqINTEGER" );
mdrOptBIGINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptBIGINT" );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2683): Uncomment when REAL is implemented:
//mdrOptREAL = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptREAL" );
mdrOptFLOAT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptFLOAT" );
mdrReqDOUBLE = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqDOUBLE" );
@@ -437,7 +440,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_TABLE_CATALOG_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 1 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 1 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -472,7 +476,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
// Not bothering with other _local_view_ test columns for TABLE_SCHEM.
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TABLE_SCHEMA_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "TABLE_SCHEMA" ), equalTo( "hive_test.default" ) );
}
@@ -486,7 +490,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_TABLE_SCHEMA_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 2 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 2 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -527,7 +532,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_TABLE_NAME_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 3 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 3 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -562,7 +568,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
// Not bothering with other _local_view_ test columns for TABLE_SCHEM.
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_NAME_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "COLUMN_NAME" ), equalTo( "listtype" ) );
}
@@ -576,7 +582,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_COLUMN_NAME_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 4 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 4 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -608,13 +615,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBOOLEAN.getInt( "ORDINAL_POSITION" ), equalTo( 1 ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( mdrReqTINYINT.getInt( "ORDINAL_POSITION" ), equalTo( 2 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( mdrOptSMALLINT.getInt( "ORDINAL_POSITION" ), equalTo( 3 ) );
@@ -630,7 +637,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBIGINT.getInt( "ORDINAL_POSITION" ), equalTo( 5 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( mdrOptREAL.getInt( "ORDINAL_POSITION" ), equalTo( 6 ) );
@@ -647,7 +654,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_ORDINAL_POSITION_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getInt( "ORDINAL_POSITION" ), equalTo( 14 ) );
}
@@ -693,7 +700,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
// Not bothering with other _local_view_ test columns for COLUMN_DEFAULT.
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_DEFAULT_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "COLUMN_DEFAULT" ), nullValue() );
}
@@ -707,7 +714,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_COLUMN_DEFAULT_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 6 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 6 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -741,14 +749,14 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
mdrOptBOOLEAN.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
mdrReqTINYINT.getString( "IS_NULLABLE" ), equalTo( "NO" ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
@@ -767,7 +775,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
mdrOptBIGINT.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
@@ -859,20 +867,20 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
mdrReqARRAY.getString( "IS_NULLABLE" ), equalTo( "NO" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tbdMAP() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
mdrReqMAP.getString( "IS_NULLABLE" ), equalTo( "NO" ) );
}
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
@Test
public void test_IS_NULLABLE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( mdrUnkSTRUCT.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
@@ -880,7 +888,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrUnkSTRUCT.getString( "IS_NULLABLE" ), equalTo( "NO" ) );
}
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
@Test
public void test_IS_NULLABLE_hasRightValue_tbdUnion() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
@@ -897,7 +905,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_IS_NULLABLE_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 7 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 7 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -929,13 +938,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBOOLEAN.getString( "DATA_TYPE" ), equalTo( "BOOLEAN" ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( mdrReqTINYINT.getString( "DATA_TYPE" ), equalTo( "TINYINT" ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( mdrOptSMALLINT.getString( "DATA_TYPE" ), equalTo( "SMALLINT" ) );
@@ -951,7 +960,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBIGINT.getString( "DATA_TYPE" ), equalTo( "BIGINT" ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( mdrOptREAL.getString( "DATA_TYPE" ), equalTo( "REAL" ) );
@@ -992,7 +1001,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptVARBINARY_16.getString( "DATA_TYPE" ), equalTo( "BINARY VARYING" ) );
}
- @Ignore( "until BINARY is actually BINARY and not VARBINARY (DRILL-xxxx)" )
+ @Ignore( "TODO(DRILL-3368): unignore when BINARY is implemented enough" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrOptBINARY_1048576() throws SQLException {
assertThat( mdrOptBINARY_1048576.getString( "DATA_TYPE" ), equalTo( "BINARY VARYING" ) ); // ?? current
@@ -1032,25 +1041,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "DATA_TYPE" ), equalTo( "ARRAY" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdMAP() throws SQLException {
assertThat( mdrReqMAP.getString( "DATA_TYPE" ), equalTo( "MAP" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( mdrUnkSTRUCT.getString( "DATA_TYPE" ), equalTo( "STRUCT" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdUnion() throws SQLException {
assertThat( mdrUnkUnion.getString( "DATA_TYPE" ), equalTo( "OTHER" ) );
fail( "Expected value is not resolved yet." );
@@ -1063,7 +1072,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_DATA_TYPE_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 8 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 8 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -1095,13 +1105,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
@@ -1117,7 +1127,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
@@ -1194,25 +1204,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "CHARACTER_MAXIMUM_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "CHARACTER_MAXIMUM_LENGTH"), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_MAXIMUM_LENGTH_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "CHARACTER_MAXIMUM_LENGTH"), nullValue() );
}
@@ -1255,19 +1265,19 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_mdrOptBIGINT() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "CHARACTER_OCTET_LENGTH" ), nullValue() );
@@ -1278,7 +1288,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTEGER, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "CHARACTER_OCTET_LENGTH" ), nullValue() );
@@ -1361,25 +1371,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "CHARACTER_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHARACTER_OCTET_LENGTH_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "CHARACTER_OCTET_LENGTH"), nullValue() );
}
@@ -1422,13 +1432,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "NUMERIC_PRECISION" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_NUMERIC_PRECISION_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "NUMERIC_PRECISION" ), equalTo( 8 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_NUMERIC_PRECISION_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "NUMERIC_PRECISION" ), equalTo( 16 ) );
@@ -1444,7 +1454,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "NUMERIC_PRECISION" ), equalTo( 64 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_NUMERIC_PRECISION_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "NUMERIC_PRECISION" ), equalTo( 24 ) );
@@ -1521,25 +1531,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "NUMERIC_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "NUMERIC_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NUMERIC_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "NUMERIC_PRECISION" ), nullValue() );
}
@@ -1582,13 +1592,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "NUMERIC_PRECISION_RADIX" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "NUMERIC_PRECISION_RADIX" ), equalTo( 2 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "NUMERIC_PRECISION_RADIX" ), equalTo( 2 ) );
@@ -1604,7 +1614,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "NUMERIC_PRECISION_RADIX" ), equalTo( 2 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "NUMERIC_PRECISION_RADIX" ), equalTo( 2 ) );
@@ -1681,25 +1691,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "NUMERIC_PRECISION_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "NUMERIC_PRECISION_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NUMERIC_PRECISION_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_PRECISION_RADIX_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "NUMERIC_PRECISION_RADIX" ), nullValue() );
}
@@ -1742,13 +1752,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "NUMERIC_SCALE" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_NUMERIC_SCALE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "NUMERIC_SCALE" ), equalTo( 0 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_NUMERIC_SCALE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "NUMERIC_SCALE" ), equalTo( 0 ) );
@@ -1764,7 +1774,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "NUMERIC_SCALE" ), equalTo( 0 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_NUMERIC_SCALE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "NUMERIC_SCALE" ), nullValue() );
@@ -1841,25 +1851,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_SCALE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "NUMERIC_SCALE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_SCALE_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "NUMERIC_SCALE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_SCALE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NUMERIC_SCALE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUMERIC_SCALE_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "NUMERIC_SCALE" ), nullValue() );
}
@@ -1902,13 +1912,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "DATETIME_PRECISION" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "DATETIME_PRECISION" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "DATETIME_PRECISION" ), nullValue() );
@@ -1924,7 +1934,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "DATETIME_PRECISION" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "DATETIME_PRECISION" ), nullValue() );
@@ -1983,14 +1993,14 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqTIME, "DATETIME_PRECISION" ), equalTo( 0 ) );
}
- @Ignore( "until datetime precision is implemented" )
+ @Ignore( "TODO(DRILL-3225): unignore when datetime precision is implemented" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrOptTIME_7() throws SQLException {
assertThat( getIntOrNull( mdrOptTIME_7, "DATETIME_PRECISION" ), equalTo( 7 ) );
}
@Test
- @Ignore( "until datetime precision is implemented" )
+ @Ignore( "TODO(DRILL-3225): unignore when datetime precision is implemented" )
public void test_DATETIME_PRECISION_hasRightValue_mdrOptTIMESTAMP() throws SQLException {
// 6 is default datetime precision for TIMESTAMP.
assertThat( getIntOrNull( mdrOptTIMESTAMP, "DATETIME_PRECISION" ), equalTo( 6 ) );
@@ -2038,7 +2048,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_3D_Mi, "DATETIME_PRECISION" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrReqINTERVAL_2D_S5() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_2D_S5, "DATETIME_PRECISION" ), equalTo( 5 ) );
@@ -2068,7 +2078,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_1H_Mi, "DATETIME_PRECISION" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets start unit prec. (DRILL-3244) " )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrReqINTERVAL_H_S3() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3H_S1, "DATETIME_PRECISION" ), equalTo( 1 ) );
@@ -2107,7 +2117,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_3S, "DATETIME_PRECISION" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets start unit prec. (DRILL-3244) " )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DATETIME_PRECISION_hasRightValue_mdrReqINTERVAL_3S1() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3S1, "DATETIME_PRECISION" ), equalTo( 1 ) );
@@ -2120,25 +2130,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATETIME_PRECISION_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "DATETIME_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATETIME_PRECISION_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "DATETIME_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATETIME_PRECISION_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "DATETIME_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATETIME_PRECISION_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "DATETIME_PRECISION" ), nullValue() );
}
@@ -2181,13 +2191,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBOOLEAN.getString( "INTERVAL_TYPE" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_INTERVAL_TYPE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( mdrReqTINYINT.getString( "INTERVAL_TYPE" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_INTERVAL_TYPE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( mdrOptSMALLINT.getString( "INTERVAL_TYPE" ), nullValue() );
@@ -2203,7 +2213,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( mdrOptBIGINT.getString( "INTERVAL_TYPE" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_INTERVAL_TYPE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( mdrOptREAL.getString( "INTERVAL_TYPE" ), nullValue() );
@@ -2352,25 +2362,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_TYPE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "INTERVAL_TYPE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_TYPE_hasRightValue_tbdMAP() throws SQLException {
assertThat( mdrReqMAP.getString( "INTERVAL_TYPE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_TYPE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "INTERVAL_TYPE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_TYPE_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "INTERVAL_TYPE" ), nullValue() );
}
@@ -2382,7 +2392,8 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
@Test
public void test_INTERVAL_TYPE_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 15 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 15 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2413,13 +2424,13 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "INTERVAL_PRECISION" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_INTERVAL_PRECISION_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "INTERVAL_PRECISION" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_INTERVAL_PRECISION_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "INTERVAL_PRECISION" ), nullValue() );
@@ -2435,7 +2446,7 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "INTERVAL_PRECISION" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_INTERVAL_PRECISION_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "INTERVAL_PRECISION" ), nullValue() );
@@ -2582,25 +2593,25 @@ public class TestInformationSchemaColumns extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_PRECISION_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "INTERVAL_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_PRECISION_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "INTERVAL_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_PRECISION_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "INTERVAL_PRECISION" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_INTERVAL_PRECISION_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "INTERVAL_PRECISION" ), nullValue() );
}
[3/3] drill git commit: DRILL-3151: Fix many ResultSetMetaData method
return values.
Posted by me...@apache.org.
DRILL-3151: Fix many ResultSetMetaData method return values.
Added ~unit test for ResultSetMetaData implementation.
Made getObject return classes available to implementation of getColumnClassName:
- Added SqlAccessor.getObjectClass() (to put that metadata right next to code
to which it corresponds rather than in far-away parallel code).
- Added similar AvaticaDrillSqlAccessor.getObjectClass().
- Changed DrillAccessorList.accessors from Accessor[] to
AvaticaDrillSqlAccessor[] for better access to JDBC getObject return class.
- Extracted return classes from accessors to pass to updateColumnMetaData.
Reworked some data type mapping and utilities:
- Added Added Types.getSqlTypeName(...).
- Renamed Types.getJdbcType(...) to getJdbcTypeCode(...)
- Replaced Types.isUnSigned with isJdbcSignedType.
- Fixed various bogus RPC-type XXX -> java.sql.Types.SMALLINT mappings.
- Removed DrillColumnMetaDataList.getJdbcTypeName.
- Moved getAvaticaType up (for bottom-up order).
- Revised DrillColumnMetaDataList.getAvaticaType(...).
MAIN:
- Updated updateColumnMetaData(...) to change many calculations of metadata
input to ColumnMetaData construction. [DrillColumnMetaDataList]
Updated other metadata tests per changes.
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/80835082
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/80835082
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/80835082
Branch: refs/heads/master
Commit: 80835082414d274fda8bf0c66fd01386180fdde5
Parents: 9932246
Author: dbarclay <db...@maprtech.com>
Authored: Fri Jun 19 19:05:39 2015 -0700
Committer: Mehant Baid <me...@gmail.com>
Committed: Thu Jul 30 18:46:02 2015 -0700
----------------------------------------------------------------------
.../org/apache/drill/common/types/Types.java | 163 ++-
.../main/codegen/templates/SqlAccessors.java | 29 +
.../vector/accessor/BoundCheckingAccessor.java | 5 +
.../exec/vector/accessor/GenericAccessor.java | 6 +
.../drill/exec/vector/accessor/SqlAccessor.java | 8 +
.../jdbc/impl/AvaticaDrillSqlAccessor.java | 7 +
.../drill/jdbc/impl/DrillAccessorList.java | 8 +-
.../jdbc/impl/DrillColumnMetaDataList.java | 185 ++-
.../org/apache/drill/jdbc/impl/DrillCursor.java | 38 +-
.../jdbc/impl/TypeConvertingSqlAccessor.java | 5 +
.../jdbc/DatabaseMetaDataGetColumnsTest.java | 323 +++--
.../drill/jdbc/DrillColumnMetaDataListTest.java | 20 +-
.../jdbc/ResultSetGetMethodConversionsTest.java | 71 +-
.../drill/jdbc/ResultSetMetaDataTest.java | 1107 ++++++++++++++++++
.../impl/TypeConvertingSqlAccessorTest.java | 5 +
.../jdbc/test/TestInformationSchemaColumns.java | 203 ++--
16 files changed, 1745 insertions(+), 438 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/common/src/main/java/org/apache/drill/common/types/Types.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/types/Types.java b/common/src/main/java/org/apache/drill/common/types/Types.java
index df484b7..69b1b4c 100644
--- a/common/src/main/java/org/apache/drill/common/types/Types.java
+++ b/common/src/main/java/org/apache/drill/common/types/Types.java
@@ -82,9 +82,85 @@ public class Types {
}
/***
+ * Gets SQL data type name for given Drill RPC-/protobuf-level data type.
+ * @return
+ * canonical keyword sequence for SQL data type (leading keywords in
+ * corresponding {@code <data type>}; what
+ * {@code INFORMATION_SCHEMA.COLUMNS.TYPE_NAME} would list)
+ */
+ public static String getSqlTypeName(final MajorType type) {
+ if (type.getMode() == DataMode.REPEATED) {
+ return "ARRAY";
+ }
+
+ switch (type.getMinorType()) {
+
+ // Standard SQL atomic data types:
+
+ case BIT: return "BOOLEAN";
+
+ case SMALLINT: return "SMALLINT";
+ case INT: return "INTEGER";
+ case BIGINT: return "BIGINT";
+
+ case FLOAT4: return "FLOAT";
+ case FLOAT8: return "DOUBLE";
+
+ case DECIMAL9:
+ case DECIMAL18:
+ case DECIMAL28DENSE:
+ case DECIMAL28SPARSE:
+ case DECIMAL38DENSE:
+ case DECIMAL38SPARSE: return "DECIMAL";
+
+ case VARCHAR: return "CHARACTER VARYING";
+ case FIXEDCHAR: return "CHARACTER";
+
+ case VAR16CHAR: return "NATIONAL CHARACTER VARYING";
+ case FIXED16CHAR: return "NATIONAL CHARACTER";
+
+ case VARBINARY: return "BINARY VARYING";
+ case FIXEDBINARY: return "BINARY";
+
+ case DATE: return "DATE";
+ case TIME: return "TIME";
+ case TIMETZ: return "TIME WITH TIME ZONE";
+ case TIMESTAMP: return "TIMESTAMP";
+ case TIMESTAMPTZ: return "TIMESTAMP WITH TIME ZONE";
+
+ case INTERVALYEAR:
+ case INTERVALDAY: return "INTERVAL";
+
+ // Non-standard SQL atomic data types:
+
+ case INTERVAL: return "INTERVAL";
+ case MONEY: return "DECIMAL";
+ case TINYINT: return "TINYINT";
+
+ // Composite types and other types that are not atomic types (SQL standard
+ // or not) except ARRAY types (handled above):
+
+ case MAP: return "MAP";
+ case LATE: return "ANY";
+ case NULL: return "NULL";
+
+ // Internal types not actually used at level of SQL types(?):
+
+ case UINT1: return "TINYINT";
+ case UINT2: return "SMALLINT";
+ case UINT4: return "INTEGER";
+ case UINT8: return "BIGINT";
+
+ default:
+ throw new AssertionError(
+ "Unexpected/unhandled MinorType value " + type.getMinorType() );
+ }
+ }
+
+ /***
* Gets JDBC type code for given Drill RPC-/protobuf-level type.
*/
- public static int getJdbcType(final MajorType type) {
+ public static int getJdbcTypeCode(final MajorType type) {
if (type.getMode() == DataMode.REPEATED) {
return java.sql.Types.ARRAY;
}
@@ -120,10 +196,13 @@ public class Types {
case MONEY:
return java.sql.Types.DECIMAL;
case NULL:
+ return java.sql.Types.NULL;
case INTERVAL:
case INTERVALYEAR:
case INTERVALDAY:
+ return java.sql.Types.OTHER; // JDBC (4.1) has nothing for INTERVAL
case LATE:
+ return java.sql.Types.OTHER;
case SMALLINT:
return java.sql.Types.SMALLINT;
case TIME:
@@ -132,7 +211,7 @@ public class Types {
case TIMESTAMP:
return java.sql.Types.TIMESTAMP;
case TIMETZ:
- return java.sql.Types.DATE;
+ return java.sql.Types.TIME;
case TINYINT:
return java.sql.Types.TINYINT;
case UINT1:
@@ -154,22 +233,80 @@ public class Types {
// is an unexpected, code-out-of-sync-with-itself case, so use an
// exception intended for that.
throw new UnsupportedOperationException(
- "Unexpected/unhandled " + type.getMinorType() + " value " + type.getMinorType() );
+ "Unexpected/unhandled MinorType value " + type.getMinorType() );
}
}
- public static boolean isUnSigned(final MajorType type) {
- switch(type.getMinorType()) {
- case UINT1:
- case UINT2:
- case UINT4:
- case UINT8:
- return true;
- default:
- return false;
+ /**
+ * Reports whether given RPC-level type is a signed type (per semantics of
+ * {@link ResultSetMetaData#isSigned(int)}).
+ */
+ public static boolean isJdbcSignedType( final MajorType type ) {
+ final boolean isSigned;
+ switch ( type.getMode() ) {
+ case REPEATED:
+ isSigned = false; // SQL ARRAY
+ break;
+ case REQUIRED:
+ case OPTIONAL:
+ switch ( type.getMinorType() ) {
+ // Verified signed types:
+ case SMALLINT:
+ case INT: // SQL INTEGER
+ case BIGINT:
+ case FLOAT4: // SQL REAL / FLOAT(N)
+ case FLOAT8: // SQL DOUBLE PRECISION / FLOAT(N)
+ case INTERVALYEAR: // SQL INTERVAL w/YEAR and/or MONTH
+ case INTERVALDAY: // SQL INTERVAL w/DAY, HOUR, MINUTE and/or SECOND
+ // Not-yet seen/verified signed types:
+ case DECIMAL9: // SQL DECIMAL (if used)
+ case DECIMAL18: // SQL DECIMAL (if used)
+ case DECIMAL28SPARSE: // SQL DECIMAL (if used)
+ case DECIMAL38SPARSE: // SQL DECIMAL (if used)
+ case DECIMAL28DENSE: // SQL DECIMAL (if used)
+ case DECIMAL38DENSE: // SQL DECIMAL (if used)
+ case TINYINT: // (not standard SQL)
+ case MONEY: // (not standard SQL)
+ case INTERVAL: // unknown (given INTERVALYEAR and INTERVALDAY)
+ isSigned = true;
+ break;
+ // Verified unsigned types:
+ case BIT: // SQL BOOLEAN
+ case VARCHAR:
+ case FIXEDCHAR: // SQL CHARACTER
+ case VARBINARY:
+ case FIXEDBINARY: // SQL BINARY
+ case DATE:
+ case TIME: // SQL TIME WITHOUT TIME ZONE
+ case TIMESTAMP: // SQL TIMESTAMP WITHOUT TIME ZONE
+ // Not-yet seen/verified unsigned types:
+ case UINT1:
+ case UINT2:
+ case UINT4:
+ case UINT8:
+ case FIXED16CHAR:
+ case VAR16CHAR:
+ case GENERIC_OBJECT:
+ case LATE:
+ case LIST:
+ case MAP:
+ case NULL:
+ case TIMETZ: // SQL TIME WITH TIME ZONE
+ case TIMESTAMPTZ: // SQL TIMESTAMP WITH TIME ZONE
+ isSigned = false;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "Unexpected/unhandled MinorType value " + type.getMinorType() );
+ }
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "Unexpected/unhandled DataMode value " + type.getMode() );
}
-
+ return isSigned;
}
+
public static boolean usesHolderForGet(final MajorType type) {
if (type.getMode() == REPEATED) {
return true;
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/java-exec/src/main/codegen/templates/SqlAccessors.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/SqlAccessors.java b/exec/java-exec/src/main/codegen/templates/SqlAccessors.java
index c50a3e2..3257499 100644
--- a/exec/java-exec/src/main/codegen/templates/SqlAccessors.java
+++ b/exec/java-exec/src/main/codegen/templates/SqlAccessors.java
@@ -24,6 +24,10 @@ import java.lang.Override;
<#list ["", "Nullable"] as mode>
<#assign name = mode + minor.class?cap_first />
<#assign javaType = (minor.javaType!type.javaType) />
+<#assign friendlyType = (minor.friendlyType!minor.boxedType!type.boxedType) />
+<#-- Class returned by ResultSet.getObject(...): -->
+<#assign jdbcObjectClass = minor.jdbcObjectClass ! friendlyType />
+
<@pp.changeOutputFile name="/org/apache/drill/exec/vector/accessor/${name}Accessor.java" />
<#include "/@includes/license.ftl" />
@@ -60,6 +64,11 @@ public class ${name}Accessor extends AbstractSqlAccessor {
}
<#if minor.class != "TimeStamp" && minor.class != "Time" && minor.class != "Date">
+ @Override
+ public Class<?> getObjectClass() {
+ return ${jdbcObjectClass}.class;
+ }
+
public Object getObject(int index) {
<#if mode == "Nullable">
if (ac.isNull(index)) {
@@ -161,6 +170,11 @@ public class ${name}Accessor extends AbstractSqlAccessor {
<#if minor.class == "TimeStampTZ">
+ @Override
+ public Class<?> getObjectClass() {
+ return Timestamp.class;
+ }
+
public Object getObject(int index) {
return getTimestamp(index);
}
@@ -200,6 +214,11 @@ public class ${name}Accessor extends AbstractSqlAccessor {
}
<#elseif minor.class == "Date">
+ @Override
+ public Class<?> getObjectClass() {
+ return Date.class;
+ }
+
public Object getObject(int index) {
<#if mode == "Nullable">
if (ac.isNull(index)) {
@@ -223,6 +242,11 @@ public class ${name}Accessor extends AbstractSqlAccessor {
<#elseif minor.class == "TimeStamp">
+ @Override
+ public Class<?> getObjectClass() {
+ return Timestamp.class;
+ }
+
public Object getObject(int index) {
<#if mode == "Nullable">
if (ac.isNull(index)) {
@@ -246,6 +270,11 @@ public class ${name}Accessor extends AbstractSqlAccessor {
<#elseif minor.class == "Time">
+ @Override
+ public Class<?> getObjectClass() {
+ return Time.class;
+ }
+
public Object getObject(int index) {
return getTime(index);
}
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/BoundCheckingAccessor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/BoundCheckingAccessor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/BoundCheckingAccessor.java
index 3d3683e..bfef947 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/BoundCheckingAccessor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/BoundCheckingAccessor.java
@@ -45,6 +45,11 @@ public class BoundCheckingAccessor implements SqlAccessor {
}
@Override
+ public Class<?> getObjectClass() {
+ return delegate.getObjectClass();
+ }
+
+ @Override
public boolean isNull(int rowOffset) {
return delegate.isNull(rowOffset);
}
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/GenericAccessor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/GenericAccessor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/GenericAccessor.java
index 65c34ad..d8f2995 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/GenericAccessor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/GenericAccessor.java
@@ -20,6 +20,7 @@ package org.apache.drill.exec.vector.accessor;
import org.apache.drill.common.types.TypeProtos;
import org.apache.drill.exec.vector.ValueVector;
+
public class GenericAccessor extends AbstractSqlAccessor {
private ValueVector v;
@@ -29,6 +30,11 @@ public class GenericAccessor extends AbstractSqlAccessor {
}
@Override
+ public Class<?> getObjectClass() {
+ return Object.class;
+ }
+
+ @Override
public boolean isNull(int index) {
return v.getAccessor().isNull(index);
}
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/SqlAccessor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/SqlAccessor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/SqlAccessor.java
index 19e6fcf..636456d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/SqlAccessor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/accessor/SqlAccessor.java
@@ -63,6 +63,14 @@ public interface SqlAccessor {
MajorType getType();
/**
+ * Reports the class returned by getObject() of this accessor.
+ * <p>
+ * (Is for {@link ResultSetMetaData#getColumnClassName(...)}.)
+ * </p>
+ */
+ Class<?> getObjectClass();
+
+ /**
* Reports whether the logical value is a SQL NULL.
*/
boolean isNull(int rowOffset);
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/AvaticaDrillSqlAccessor.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/AvaticaDrillSqlAccessor.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/AvaticaDrillSqlAccessor.java
index 64f5b87..7e53a07 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/AvaticaDrillSqlAccessor.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/AvaticaDrillSqlAccessor.java
@@ -78,6 +78,13 @@ class AvaticaDrillSqlAccessor implements Accessor {
}
}
+ /**
+ * @see SQLAccesstor#getObjectClass()
+ */
+ public Class<?> getObjectClass() {
+ return underlyingAccessor.getObjectClass();
+ }
+
@Override
public boolean wasNull() throws SQLException {
return underlyingAccessor.isNull(getCurrentRecordNumber());
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillAccessorList.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillAccessorList.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillAccessorList.java
index 25ca1ba..9284875 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillAccessorList.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillAccessorList.java
@@ -31,14 +31,14 @@ import org.apache.drill.exec.vector.accessor.SqlAccessor;
class DrillAccessorList extends BasicList<Accessor>{
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillAccessorList.class);
- private Accessor[] accessors = new Accessor[0];
+ private AvaticaDrillSqlAccessor[] accessors = new AvaticaDrillSqlAccessor[0];
// TODO Rename to lastColumnAccessed and/or document.
// TODO Why 1, rather than, say, -1?
private int lastColumn = 1;
- void generateAccessors(DrillCursor cursor, RecordBatchLoader currentBatch){
+ void generateAccessors(DrillCursor cursor, RecordBatchLoader currentBatch) {
int cnt = currentBatch.getSchema().getFieldCount();
- accessors = new Accessor[cnt];
+ accessors = new AvaticaDrillSqlAccessor[cnt];
for(int i =0; i < cnt; i++){
final ValueVector vector = currentBatch.getValueAccessorById(null, i).getValueVector();
final SqlAccessor acc =
@@ -50,7 +50,7 @@ class DrillAccessorList extends BasicList<Accessor>{
}
@Override
- public Accessor get(int index) {
+ public AvaticaDrillSqlAccessor get(int index) {
lastColumn = index;
return accessors[index];
}
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillColumnMetaDataList.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillColumnMetaDataList.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillColumnMetaDataList.java
index d43755e..1813cc7 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillColumnMetaDataList.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillColumnMetaDataList.java
@@ -41,7 +41,7 @@ public class DrillColumnMetaDataList extends BasicList<ColumnMetaData>{
@Override
public int size() {
- return (columns.size());
+ return columns.size();
}
@Override
@@ -49,121 +49,80 @@ public class DrillColumnMetaDataList extends BasicList<ColumnMetaData>{
return columns.get(index);
}
- public void updateColumnMetaData(String catalogName, String schemaName, String tableName, BatchSchema schema){
-
- columns = new ArrayList<ColumnMetaData>(schema.getFieldCount());
- for(int i = 0; i < schema.getFieldCount(); i++){
- MaterializedField f = schema.getColumn(i);
- MajorType t = f.getType();
- ColumnMetaData col = new ColumnMetaData( //
- i, // ordinal
- false, // autoIncrement
- true, // caseSensitive
- false, // searchable
- false, // currency
- f.getDataMode() == DataMode.OPTIONAL ? ResultSetMetaData.columnNullable : ResultSetMetaData.columnNoNulls, //nullability
- !Types.isUnSigned(t), // signed
- 10, // display size.
- f.getAsSchemaPath().getRootSegment().getPath(), // label
- f.getAsSchemaPath().getRootSegment().getPath(), // columnname
- schemaName, // schemaname
- t.hasPrecision() ? t.getPrecision() : 0, // precision
- t.hasScale() ? t.getScale() : 0, // scale
- null, // tablename is null so sqlline doesn't try to retrieve primary keys.
- catalogName, // catalogname
- getAvaticaType(t), // sql type
- true, // readonly
- false, // writable
- false, // definitely writable
- "none" // column class name
- );
- columns.add(col);
- }
+ /**
+ * Gets AvaticaType carrying both JDBC {@code java.sql.Type.*} type code
+ * and SQL type name for given RPC-level type (from batch schema).
+ */
+ private static AvaticaType getAvaticaType( MajorType rpcDateType ) {
+ final String sqlTypeName = Types.getSqlTypeName( rpcDateType );
+ final int jdbcTypeId = Types.getJdbcTypeCode( rpcDateType );
+ return ColumnMetaData.scalar( jdbcTypeId, sqlTypeName,
+ Rep.BOOLEAN /* dummy value, unused */ );
}
- private static AvaticaType getAvaticaType(MajorType t){
- final int jdbcTypeId = Types.getJdbcType(t);
- return ColumnMetaData.scalar(jdbcTypeId, getJdbcTypeName(jdbcTypeId), Rep.BOOLEAN /* dummy value, unused */);
- }
-
- private static String getJdbcTypeName(int type) {
- switch (type) {
- case java.sql.Types.BIT:
- return "BIT";
- case java.sql.Types.TINYINT:
- return "TINYINT";
- case java.sql.Types.SMALLINT:
- return "SMALLINT";
- case java.sql.Types.INTEGER:
- return "INTEGER";
- case java.sql.Types.BIGINT:
- return "BIGINT";
- case java.sql.Types.FLOAT:
- return "FLOAT";
- case java.sql.Types.REAL:
- return "REAL";
- case java.sql.Types.DOUBLE:
- return "DOUBLE";
- case java.sql.Types.NUMERIC:
- return "NUMERIC";
- case java.sql.Types.DECIMAL:
- return "DECIMAL";
- case java.sql.Types.CHAR:
- return "CHAR";
- case java.sql.Types.VARCHAR:
- return "VARCHAR";
- case java.sql.Types.LONGVARCHAR:
- return "LONGVARCHAR";
- case java.sql.Types.DATE:
- return "DATE";
- case java.sql.Types.TIME:
- return "TIME";
- case java.sql.Types.TIMESTAMP:
- return "TIMESTAMP";
- case java.sql.Types.BINARY:
- return "BINARY";
- case java.sql.Types.VARBINARY:
- return "VARBINARY";
- case java.sql.Types.LONGVARBINARY:
- return "LONGVARBINARY";
- case java.sql.Types.NULL:
- return "NULL";
- case java.sql.Types.OTHER:
- return "OTHER";
- case java.sql.Types.JAVA_OBJECT:
- return "JAVA_OBJECT";
- case java.sql.Types.DISTINCT:
- return "DISTINCT";
- case java.sql.Types.STRUCT:
- return "STRUCT";
- case java.sql.Types.ARRAY:
- return "ARRAY";
- case java.sql.Types.BLOB:
- return "BLOB";
- case java.sql.Types.CLOB:
- return "CLOB";
- case java.sql.Types.REF:
- return "REF";
- case java.sql.Types.DATALINK:
- return "DATALINK";
- case java.sql.Types.BOOLEAN:
- return "BOOLEAN";
- case java.sql.Types.ROWID:
- return "ROWID";
- case java.sql.Types.NCHAR:
- return "NCHAR";
- case java.sql.Types.NVARCHAR:
- return "NVARCHAR";
- case java.sql.Types.LONGNVARCHAR:
- return "LONGNVARCHAR";
- case java.sql.Types.NCLOB:
- return "NCLOB";
- case java.sql.Types.SQLXML:
- return "SQLXML";
- default:
- logger.error( "Unexpected java.sql.Types value {}", type );
- return "unknown java.sql.Types value " + type;
+ public void updateColumnMetaData(String catalogName, String schemaName,
+ String tableName, BatchSchema schema,
+ List<Class<?>> getObjectClasses ) {
+ final List<ColumnMetaData> newColumns =
+ new ArrayList<ColumnMetaData>(schema.getFieldCount());
+ for (int colOffset = 0; colOffset < schema.getFieldCount(); colOffset++) {
+ final MaterializedField field = schema.getColumn(colOffset);
+ Class<?> objectClass = getObjectClasses.get( colOffset );
+
+ final String columnName = field.getPath().getRootSegment().getPath();
+
+ final MajorType rpcDataType = field.getType();
+ final AvaticaType bundledSqlDataType = getAvaticaType(rpcDataType);
+ final String columnClassName = objectClass.getName();
+
+ final int nullability;
+ switch ( field.getDataMode() ) {
+ case OPTIONAL: nullability = ResultSetMetaData.columnNullable; break;
+ case REQUIRED: nullability = ResultSetMetaData.columnNoNulls; break;
+ // Should REPEATED still map to columnNoNulls? or to columnNullable?
+ case REPEATED: nullability = ResultSetMetaData.columnNoNulls; break;
+ default:
+ throw new AssertionError( "Unexpected new DataMode value '"
+ + field.getDataMode().name() + "'" );
+ }
+ final boolean isSigned = Types.isJdbcSignedType( rpcDataType );
+
+ // TODO(DRILL-3355): TODO(DRILL-3356): When string lengths, precisions,
+ // interval kinds, etc., are available from RPC-level data, implement:
+ // - precision for ResultSetMetadata.getPrecision(...) (like
+ // getColumns()'s COLUMN_SIZE)
+ // - scale for getScale(...), and
+ // - and displaySize for getColumnDisplaySize(...).
+ final int precision =
+ rpcDataType.hasPrecision() ? rpcDataType.getPrecision() : 0;
+ final int scale = rpcDataType.hasScale() ? rpcDataType.getScale() : 0;
+ final int displaySize = 10;
+
+ ColumnMetaData col = new ColumnMetaData(
+ colOffset, // (zero-based ordinal (for Java arrays/lists).)
+ false, /* autoIncrement */
+ false, /* caseSensitive */
+ true, /* searchable */
+ false, /* currency */
+ nullability,
+ isSigned,
+ displaySize,
+ columnName, /* label */
+ columnName, /* columnName */
+ schemaName,
+ precision,
+ scale,
+ tableName,
+ catalogName,
+ bundledSqlDataType,
+ true, /* readOnly */
+ false, /* writable */
+ false, /* definitelyWritable */
+ columnClassName
+ );
+ newColumns.add(col);
}
+ columns = newColumns;
}
@Override
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java
index 5ae7509..07d7066 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java
@@ -18,6 +18,7 @@
package org.apache.drill.jdbc.impl;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@@ -31,6 +32,7 @@ import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.record.BatchSchema;
import org.apache.drill.exec.record.RecordBatchLoader;
import org.apache.drill.exec.rpc.user.QueryDataBatch;
+import org.apache.drill.exec.store.ischema.InfoSchemaConstants;
import org.slf4j.Logger;
import static org.slf4j.LoggerFactory.getLogger;
@@ -38,7 +40,8 @@ import static org.slf4j.LoggerFactory.getLogger;
class DrillCursor implements Cursor {
private static final Logger logger = getLogger( DrillCursor.class );
- private static final String UNKNOWN = "--UNKNOWN--";
+ /** JDBC-specified string for unknown catalog, schema, and table names. */
+ private static final String UNKNOWN_NAME_STRING = "";
/** The associated {@link java.sql.ResultSet} implementation. */
private final DrillResultSetImpl resultSet;
@@ -104,6 +107,10 @@ class DrillCursor implements Cursor {
return currentRecordNumber;
}
+ // (Overly restrictive Avatica uses List<Accessor> instead of List<? extends
+ // Accessor>, so accessors/DrillAccessorList can't be of type
+ // List<AvaticaDrillSqlAccessor>, and we have to cast from Accessor to
+ // AvaticaDrillSqlAccessor in updateColumns().)
@Override
public List<Accessor> createAccessors(List<ColumnMetaData> types,
Calendar localCalendar, Factory factory) {
@@ -111,9 +118,31 @@ class DrillCursor implements Cursor {
return accessors;
}
+ /**
+ * Updates column accessors and metadata from current record batch.
+ */
private void updateColumns() {
+ // First update accessors and schema from batch:
accessors.generateAccessors(this, currentBatchHolder);
- columnMetaDataList.updateColumnMetaData(UNKNOWN, UNKNOWN, UNKNOWN, schema);
+
+ // Extract Java types from accessors for metadata's getColumnClassName:
+ final List<Class<?>> getObjectClasses = new ArrayList<>();
+ // (Can't use modern for loop because, for some incompletely clear reason,
+ // DrillAccessorList blocks iterator() (throwing exception).)
+ for ( int ax = 0; ax < accessors.size(); ax++ ) {
+ final AvaticaDrillSqlAccessor accessor =
+ (AvaticaDrillSqlAccessor) accessors.get( ax );
+ getObjectClasses.add( accessor.getObjectClass() );
+ }
+
+ // Update metadata for result set.
+ columnMetaDataList.updateColumnMetaData(
+ InfoSchemaConstants.IS_CATALOG_NAME,
+ UNKNOWN_NAME_STRING, // schema name
+ UNKNOWN_NAME_STRING, // table name
+ schema,
+ getObjectClasses );
+
if (getResultSet().changeListener != null) {
getResultSet().changeListener.schemaChanged(schema);
}
@@ -180,8 +209,9 @@ class DrillCursor implements Cursor {
afterLastRow = true;
return false;
} else {
- // Got next (or first) batch--reset record offset to beginning,
- // assimilate schema if changed, ... ???
+ // Got next (or first) batch--reset record offset to beginning;
+ // assimilate schema if changed; set up return value for first call
+ // to next().
currentRecordNumber = 0;
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessor.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessor.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessor.java
index b542f94..2e17e33 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessor.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/TypeConvertingSqlAccessor.java
@@ -46,6 +46,11 @@ class TypeConvertingSqlAccessor implements SqlAccessor {
}
@Override
+ public Class<?> getObjectClass() {
+ return innerAccessor.getObjectClass();
+ }
+
+ @Override
public boolean isNull( int rowOffset ) {
return innerAccessor.isNull( rowOffset );
}
[2/3] drill git commit: DRILL-3151: Fix many ResultSetMetaData method
return values.
Posted by me...@apache.org.
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/DatabaseMetaDataGetColumnsTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DatabaseMetaDataGetColumnsTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DatabaseMetaDataGetColumnsTest.java
index 15c9d5c..5676dea 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DatabaseMetaDataGetColumnsTest.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DatabaseMetaDataGetColumnsTest.java
@@ -43,7 +43,7 @@ import static java.sql.ResultSetMetaData.columnNullableUnknown;
import java.sql.SQLException;
import java.sql.Types;
-// NOTE: TempInformationSchemaColumnsTest and DatabaseMetaDataGetColumnsTest
+// NOTE: TestInformationSchemaColumns and DatabaseMetaDataGetColumnsTest
// have identical sections. (Cross-maintain them for now; factor out later.)
// TODO: MOVE notes to implementation (have this not (just) in test).
@@ -95,7 +95,6 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
/** Overall (connection-level) metadata. */
private static DatabaseMetaData dbMetadata;
-
/** getColumns result metadata. For checking columns themselves (not cell
* values or row order). */
private static ResultSetMetaData rowsMetadata;
@@ -229,7 +228,9 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertTrue( util.next() );
assertTrue( "Error setting schema for test: " + util.getString( 2 ),
util.getBoolean( 1 ) );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2470): Adjust when TINYINT is implemented:
+ // TODO(DRILL-2470): Adjust when SMALLINT is implemented:
+ // TODO(DRILL-2683): Adjust when REAL is implemented:
util = stmt.executeQuery(
""
+ "CREATE OR REPLACE VIEW " + VIEW_NAME + " AS SELECT "
@@ -286,13 +287,14 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
mdrOptBOOLEAN = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptBOOLEAN" );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2470): Uncomment when TINYINT is implemented:
//mdrReqTINYINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqTINYINT" );
+ // TODO(DRILL-2470): Uncomment when SMALLINT is implemented:
//mdrOptSMALLINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptSMALLINT" );
mdrReqINTEGER = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqINTEGER" );
mdrOptBIGINT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptBIGINT" );
- // TODO(DRILL-2470): re-enable TINYINT, SMALLINT, and REAL.
+ // TODO(DRILL-2683): Uncomment when REAL is implemented:
//mdrOptREAL = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptREAL" );
mdrOptFLOAT = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrOptFLOAT" );
mdrReqDOUBLE = setUpRow( VIEW_SCHEMA, VIEW_NAME, "mdrReqDOUBLE" );
@@ -399,7 +401,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TABLE_CAT_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 1 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 1 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -407,12 +410,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 1 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_TABLE_CAT_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 1 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@@ -442,7 +445,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
// Not bothering with other _local_view_ test columns for TABLE_SCHEM.
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TABLE_SCHEM_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "TABLE_SCHEM" ),
equalTo( "hive_test.default" ) );
@@ -457,7 +460,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TABLE_SCHEM_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 2 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 2 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -465,18 +469,17 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 2 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_TABLE_SCHEM_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 2 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
public void test_TABLE_SCHEM_hasRightNullability() throws SQLException {
- // To-do: CHECK: Why columnNullable, when seemingly known nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
rowsMetadata.isNullable( 2 ), equalTo( columnNoNulls ) );
}
@@ -507,7 +510,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TABLE_NAME_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 3 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 3 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -515,19 +519,17 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 3 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_TABLE_NAME_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 3 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
public void test_TABLE_NAME_hasRightNullability() throws SQLException {
- // To-do: CHECK: Why columnNullable, when seemingly known nullable?
- // (Why not like TABLE_CAT, which does have columnNoNulls?)
assertThat( "ResultSetMetaData.column...Null... nullability code:",
rowsMetadata.isNullable( 3 ), equalTo( columnNoNulls ) );
}
@@ -552,7 +554,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
// Not bothering with other _local_view_ test columns for TABLE_SCHEM.
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_NAME_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "COLUMN_NAME" ), equalTo( "listtype" ) );
}
@@ -566,7 +568,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_COLUMN_NAME_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 4 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 4 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -574,19 +577,17 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 4 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_COLUMN_NAME_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 4 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
public void test_COLUMN_NAME_hasRightNullability() throws SQLException {
- // To-do: CHECK: Why columnNullable, when seemingly known nullable?
- // (Why not like TABLE_CAT, which does have columnNoNulls?)
assertThat( "ResultSetMetaData.column...Null... nullability code:",
rowsMetadata.isNullable( 4 ), equalTo( columnNoNulls ) );
}
@@ -608,13 +609,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "DATA_TYPE" ), equalTo( Types.BOOLEAN ) );
}
- @Ignore( "until tinyint is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "DATA_TYPE" ), equalTo( Types.TINYINT ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "DATA_TYPE" ), equalTo( Types.SMALLINT ) );
@@ -630,7 +631,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "DATA_TYPE" ), equalTo( Types.BIGINT ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_DATA_TYPE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "DATA_TYPE" ), equalTo( Types.REAL ) );
@@ -707,13 +708,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "DATA_TYPE" ), equalTo( Types.ARRAY ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdMAP() throws SQLException {
assertThat( "java.sql.Types.* type code",
getIntOrNull( mdrReqMAP, "DATA_TYPE" ), equalTo( Types.OTHER ) );
@@ -723,13 +724,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "DATA_TYPE" ), equalTo( Types.STRUCT ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DATA_TYPE_hasRightValue_tbdUnion() throws SQLException {
assertThat( "java.sql.Types.* type code",
getIntOrNull( mdrUnkUnion, "DATA_TYPE" ), equalTo( Types.OTHER ) );
@@ -753,10 +754,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 5 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_DATA_TYPE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 5 ),
equalTo( Integer.class.getName() ) );
}
@@ -785,13 +784,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( mdrOptBOOLEAN.getString( "TYPE_NAME" ), equalTo( "BOOLEAN" ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_TYPE_NAME_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( mdrReqTINYINT.getString( "TYPE_NAME" ), equalTo( "TINYINT" ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_TYPE_NAME_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( mdrOptSMALLINT.getString( "TYPE_NAME" ), equalTo( "SMALLINT" ) );
@@ -807,7 +806,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( mdrOptBIGINT.getString( "TYPE_NAME" ), equalTo( "BIGINT" ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_TYPE_NAME_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( mdrOptREAL.getString( "TYPE_NAME" ), equalTo( "REAL" ) );
@@ -830,12 +829,14 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TYPE_NAME_hasRightValue_mdrReqVARCHAR_10() throws SQLException {
- assertThat( mdrReqVARCHAR_10.getString( "TYPE_NAME" ), equalTo( "CHARACTER VARYING" ) );
+ assertThat( mdrReqVARCHAR_10.getString( "TYPE_NAME" ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
public void test_TYPE_NAME_hasRightValue_mdrOptVARCHAR() throws SQLException {
- assertThat( mdrOptVARCHAR.getString( "TYPE_NAME" ), equalTo( "CHARACTER VARYING" ) );
+ assertThat( mdrOptVARCHAR.getString( "TYPE_NAME" ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -845,12 +846,14 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TYPE_NAME_hasRightValue_mdrOptVARBINARY_16() throws SQLException {
- assertThat( mdrOptVARBINARY_16.getString( "TYPE_NAME" ), equalTo( "BINARY VARYING" ) );
+ assertThat( mdrOptVARBINARY_16.getString( "TYPE_NAME" ),
+ equalTo( "BINARY VARYING" ) );
}
@Test
public void test_TYPE_NAME_hasRightValue_mdrOptBINARY_1048576CHECK() throws SQLException {
- assertThat( mdrOptBINARY_1048576.getString( "TYPE_NAME" ), equalTo( "BINARY VARYING" ) );
+ assertThat( mdrOptBINARY_1048576.getString( "TYPE_NAME" ),
+ equalTo( "BINARY VARYING" ) );
}
@Test
@@ -886,25 +889,25 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TYPE_NAME_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "TYPE_NAME" ), equalTo( "ARRAY" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TYPE_NAME_hasRightValue_tbdMAP() throws SQLException {
assertThat( mdrReqMAP.getString( "TYPE_NAME" ), equalTo( "MAP" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TYPE_NAME_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( mdrUnkSTRUCT.getString( "TYPE_NAME" ), equalTo( "STRUCT" ) );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_TYPE_NAME_hasRightValue_tbdUnion() throws SQLException {
assertThat( mdrUnkUnion.getString( "TYPE_NAME" ), equalTo( "OTHER" ) );
fail( "Expected value is not resolved yet." );
@@ -917,7 +920,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_TYPE_NAME_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 6 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 6 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -925,18 +929,17 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 6 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_TYPE_NAME_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 6 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
public void test_TYPE_NAME_hasRightNullability() throws SQLException {
- // To-do: CHECK: Why columnNullable, when seemingly known nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
rowsMetadata.isNullable( 6 ), equalTo( columnNoNulls ) );
}
@@ -968,14 +971,14 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "COLUMN_SIZE" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrReqTINYINT() throws SQLException {
// 8 bits
assertThat( getIntOrNull( mdrReqTINYINT, "COLUMN_SIZE" ), equalTo( 8 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrOptSMALLINT() throws SQLException {
// 16 bits
@@ -994,7 +997,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "COLUMN_SIZE" ), equalTo( 64 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrOptREAL() throws SQLException {
// 24 bits of precision
@@ -1054,7 +1057,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
equalTo( 8 /* HH:MM:SS */ ) );
}
- @Ignore( "until datetime precision is implemented" )
+ @Ignore( "TODO(DRILL-3225): unignore when datetime precision is implemented" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrOptTIME_7() throws SQLException {
assertThat( getIntOrNull( mdrOptTIME_7, "COLUMN_SIZE" ),
@@ -1110,8 +1113,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
equalTo( 12 ) ); // "P123DT12H12M"
}
-
- @Ignore( "until fixed: fractional secs. prec. gets start unit prec. (DRILL-3244) " )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrReqINTERVAL_2D_S5() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_2D_S5, "COLUMN_SIZE" ),
@@ -1136,7 +1138,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
equalTo( 7 ) ); // "PT1H12M"
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrReqINTERVAL_3H_S1() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3H_S1, "COLUMN_SIZE" ),
@@ -1174,7 +1176,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
equalTo( 13 ) ); // "PT123.123456S"
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_COLUMN_SIZE_hasRightValue_mdrReqINTERVAL_3S1() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3S1, "COLUMN_SIZE" ),
@@ -1189,25 +1191,25 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_SIZE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "COLUMN_SIZE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_SIZE_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "COLUMN_SIZE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_SIZE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "COLUMN_SIZE" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_COLUMN_SIZE_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "COLUMN_SIZE" ), nullValue() );
}
@@ -1227,10 +1229,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 7 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_COLUMN_SIZE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 7 ),
equalTo( Integer.class.getName() ) );
}
@@ -1281,13 +1281,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "DECIMAL_DIGITS" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "DECIMAL_DIGITS" ), equalTo( 0 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "DECIMAL_DIGITS" ), equalTo( 0 ) );
@@ -1303,7 +1303,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "DECIMAL_DIGITS" ), equalTo( 0 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "DECIMAL_DIGITS" ), equalTo( 7 ) );
@@ -1362,7 +1362,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqTIME, "DECIMAL_DIGITS" ), equalTo( 0 ) );
}
- @Ignore( "until datetime precision is implemented" )
+ @Ignore( "TODO(DRILL-3225): unignore when datetime precision is implemented" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrOptTIME_7() throws SQLException {
assertThat( getIntOrNull( mdrOptTIME_7, "DECIMAL_DIGITS" ), equalTo( 7 ) );
@@ -1374,7 +1374,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
getIntOrNull( mdrOptTIME_7, "DECIMAL_DIGITS" ), equalTo( 0 ) );
}
- @Ignore( "until datetime precision is implemented" )
+ @Ignore( "TODO(DRILL-3225): unignore when datetime precision is implemented" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrOptTIMESTAMP() throws SQLException {
// 6 is default datetime precision for TIMESTAMP.
@@ -1424,7 +1424,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_3D_Mi, "DECIMAL_DIGITS" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrReqINTERVAL_2D_S5() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_2D_S5, "DECIMAL_DIGITS" ), equalTo( 5 ) );
@@ -1454,7 +1454,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_1H_Mi, "DECIMAL_DIGITS" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrReqINTERVAL_3H_S1() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3H_S1, "DECIMAL_DIGITS" ), equalTo( 1 ) );
@@ -1495,7 +1495,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTERVAL_3S, "DECIMAL_DIGITS" ), equalTo( 6 ) );
}
- @Ignore( "until fixed: fractional secs. prec. gets wrong value (DRILL-3244)" )
+ @Ignore( "TODO(DRILL-3244): unignore when fractional secs. prec. is right" )
@Test
public void test_DECIMAL_DIGITS_hasRightValue_mdrReqINTERVAL_3S1() throws SQLException {
assertThat( getIntOrNull( mdrReqINTERVAL_3S, "DECIMAL_DIGITS" ), equalTo( 1 ) );
@@ -1508,25 +1508,25 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DECIMAL_DIGITS_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "DECIMAL_DIGITS" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DECIMAL_DIGITS_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "DECIMAL_DIGITS" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DECIMAL_DIGITS_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "DECIMAL_DIGITS" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_DECIMAL_DIGITS_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "DECIMAL_DIGITS" ), nullValue() );
}
@@ -1546,10 +1546,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 9 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_DECIMAL_DIGITS_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 9 ),
equalTo( Integer.class.getName() ) );
}
@@ -1581,13 +1579,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "NUM_PREC_RADIX" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_NUM_PREC_RADIX_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "NUM_PREC_RADIX" ), equalTo( 2 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_NUM_PREC_RADIX_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "NUM_PREC_RADIX" ), equalTo( 2 ) );
@@ -1603,7 +1601,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "NUM_PREC_RADIX" ), equalTo( 2 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_NUM_PREC_RADIX_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "NUM_PREC_RADIX" ), equalTo( 2 ) );
@@ -1680,25 +1678,25 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUM_PREC_RADIX_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "NUM_PREC_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUM_PREC_RADIX_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "NUM_PREC_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUM_PREC_RADIX_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NUM_PREC_RADIX" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NUM_PREC_RADIX_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "NUM_PREC_RADIX" ), nullValue() );
}
@@ -1718,10 +1716,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 10 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_NUM_PREC_RADIX_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 10 ),
equalTo( Integer.class.getName() ) );
}
@@ -1754,15 +1750,14 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
getIntOrNull( mdrOptBOOLEAN, "NULLABLE" ), equalTo( columnNoNulls ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_NULLABLE_hasRightValue_mdrReqTINYINT() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqTINYINT, "NULLABLE" ), equalTo( columnNoNulls ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_NULLABLE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
@@ -1775,7 +1770,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
getIntOrNull( mdrOptBIGINT, "NULLABLE" ), equalTo( columnNullable ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_NULLABLE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
@@ -1784,7 +1779,6 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_NULLABLE_hasRightValue_mdrOptFLOAT() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrOptFLOAT, "NULLABLE" ), equalTo( columnNullable ) );
}
@@ -1797,21 +1791,18 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_NULLABLE_hasRightValue_mdrReqINTEGER() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqINTEGER, "NULLABLE" ), equalTo( columnNoNulls ) );
}
@Test
public void test_NULLABLE_hasRightValue_mdrReqDECIMAL_5_3() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqDECIMAL_5_3, "NULLABLE" ), equalTo( columnNoNulls ) );
}
@Test
public void test_NULLABLE_hasRightValue_mdrReqVARCHAR_10() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqVARCHAR_10, "NULLABLE" ), equalTo( columnNoNulls ) );
}
@@ -1824,7 +1815,6 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_NULLABLE_hasRightValue_mdrReqCHAR_5() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqCHAR_5, "NULLABLE" ), equalTo( columnNoNulls ) );
}
@@ -1843,7 +1833,6 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_NULLABLE_hasRightValue_mdrReqDATE() throws SQLException {
- // To-do: CHECK: Why columnNullableUnknown, when seemingly known non-nullable?
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrReqDATE, "NULLABLE" ), equalTo( columnNoNulls ) );
}
@@ -1879,7 +1868,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NULLABLE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "NULLABLE" ), equalTo( columnNoNulls ) );
// To-do: Determine which.
@@ -1889,7 +1878,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NULLABLE_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "NULLABLE" ), equalTo( columnNoNulls ) );
// To-do: Determine which.
@@ -1898,8 +1887,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqMAP, "NULLABLE" ), equalTo( columnNullableUnknown ) );
}
- @Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NULLABLE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NULLABLE" ), equalTo( columnNullable ) );
// To-do: Determine which.
@@ -1908,8 +1897,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrUnkSTRUCT, "NULLABLE" ), equalTo( columnNullableUnknown ) );
}
- @Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@Test
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_NULLABLE_hasRightValue_tbdUnion() throws SQLException {
assertThat( "ResultSetMetaData.column...Null... nullability code:",
getIntOrNull( mdrUnkUnion, "NULLABLE" ), equalTo( columnNullable ) );
@@ -1936,10 +1925,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 11 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_NULLABLE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 11 ),
equalTo( Integer.class.getName() ) );
}
@@ -1974,7 +1961,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_REMARKS_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 12 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 12 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -1982,12 +1970,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 12 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_REMARKS_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 12 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2022,7 +2010,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_COLUMN_DEF_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 13 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 13 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2030,12 +2019,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 13 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_COLUMN_DEF_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 13 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2046,7 +2035,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
////////////////////////////////////////////////////////////
- // #14: SQL_DATA_??TYPE:
+ // #14: SQL_DATA_TYPE:
// - JDBC: "14. ... int => unused"
// - Drill:
// - (Meta): INTEGER(?);
@@ -2075,10 +2064,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 14 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SQL_DATA_TYPE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 14 ),
equalTo( Integer.class.getName() ) );
}
@@ -2114,10 +2101,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 15 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SQL_DATETIME_SUB_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 15 ),
equalTo( Integer.class.getName() ) );
}
@@ -2141,13 +2126,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "CHAR_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_CHAR_OCTET_LENGTH_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "CHAR_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_CHAR_OCTET_LENGTH_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "CHAR_OCTET_LENGTH" ), nullValue() );
@@ -2158,7 +2143,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrReqINTEGER, "CHAR_OCTET_LENGTH" ), nullValue() );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_CHAR_OCTET_LENGTH_hasRightValue_mdrOptBIGINT() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "CHAR_OCTET_LENGTH" ), nullValue() );
@@ -2241,25 +2226,25 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHAR_OCTET_LENGTH_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "CHAR_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHAR_OCTET_LENGTH_hasRightValue_tbdMAP() throws SQLException {
assertThat( getIntOrNull( mdrReqMAP, "CHAR_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHAR_OCTET_LENGTH_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( getIntOrNull( mdrUnkSTRUCT, "CHAR_OCTET_LENGTH" ), nullValue() );
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_CHAR_OCTET_LENGTH_hasRightValue_tbdUnion() throws SQLException {
assertThat( getIntOrNull( mdrUnkUnion, "CHAR_OCTET_LENGTH" ), nullValue() );
}
@@ -2279,10 +2264,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 16 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_CHAR_OCTET_LENGTH_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 16 ),
equalTo( Integer.class.getName() ) );
}
@@ -2310,13 +2293,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBOOLEAN, "ORDINAL_POSITION" ), equalTo( 1 ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( getIntOrNull( mdrReqTINYINT, "ORDINAL_POSITION" ), equalTo( 2 ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( getIntOrNull( mdrOptSMALLINT, "ORDINAL_POSITION" ), equalTo( 3 ) );
@@ -2332,7 +2315,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( getIntOrNull( mdrOptBIGINT, "ORDINAL_POSITION" ), equalTo( 5 ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_ORDINAL_POSITION_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( getIntOrNull( mdrOptREAL, "ORDINAL_POSITION" ), equalTo( 6 ) );
@@ -2349,7 +2332,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_ORDINAL_POSITION_hasRightValue_tdbARRAY() throws SQLException {
assertThat( getIntOrNull( mdrReqARRAY, "ORDINAL_POSITION" ), equalTo( 14 ) );
}
@@ -2369,10 +2352,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 17 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_ORDINAL_POSITION_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 17 ),
equalTo( Integer.class.getName() ) );
}
@@ -2403,13 +2384,13 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( mdrOptBOOLEAN.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
}
- @Ignore( "until TINYINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrReqTINYINT() throws SQLException {
assertThat( mdrReqTINYINT.getString( "IS_NULLABLE" ), equalTo( "NO" ) );
}
- @Ignore( "until SMALLINT is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrOptSMALLINT() throws SQLException {
assertThat( mdrOptSMALLINT.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
@@ -2425,7 +2406,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( mdrOptBIGINT.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
}
- @Ignore( "until REAL is implemented. (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_IS_NULLABLE_hasRightValue_mdrOptREAL() throws SQLException {
assertThat( mdrOptREAL.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
@@ -2502,7 +2483,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tdbARRAY() throws SQLException {
assertThat( mdrReqARRAY.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
// To-do: Determine which.
@@ -2512,7 +2493,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tbdMAP() throws SQLException {
assertThat( mdrReqMAP.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
// To-do: Determine which.
@@ -2522,7 +2503,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tbdSTRUCT() throws SQLException {
assertThat( mdrUnkSTRUCT.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
// To-do: Determine which.
@@ -2532,7 +2513,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
}
@Test
- @Ignore( "until we have test plugin supporting all needed types (DRILL-3253)." )
+ @Ignore( "TODO(DRILL-3253): unignore when we have all-types test storage plugin" )
public void test_IS_NULLABLE_hasRightValue_tbdUnion() throws SQLException {
assertThat( mdrUnkUnion.getString( "IS_NULLABLE" ), equalTo( "YES" ) );
// To-do: Determine which.
@@ -2548,7 +2529,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_IS_NULLABLE_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 18 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 18 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2556,12 +2538,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 18 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_IS_NULLABLE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 18 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Ignore( "until resolved: any requirement on nullability (DRILL-2420?)" )
@@ -2597,7 +2579,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_SCOPE_CATALOG_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 19 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 19 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2605,12 +2588,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 19 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SCOPE_CATALOG_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 19 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2645,7 +2628,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_SCOPE_SCHEMA_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 20 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 20 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2653,12 +2637,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 20 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SCOPE_SCHEMA_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 20 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2693,7 +2677,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_SCOPE_TABLE_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 21 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 21 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2701,12 +2686,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 21 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SCOPE_TABLE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 21 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2753,10 +2738,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 22 ), equalTo( Types.INTEGER ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_SOURCE_DATA_TYPE_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.Integer" is correct:
assertThat( rowsMetadata.getColumnClassName( 22 ),
equalTo( Integer.class.getName() ) );
}
@@ -2784,7 +2767,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_IS_AUTOINCREMENT_hasRightValue_mdrOptBOOLEAN() throws SQLException {
- // TODO: Can is be 'NO' (not auto-increment) rather than '' (unknown)?
+ // TODO: Can it be 'NO' (not auto-increment) rather than '' (unknown)?
assertThat( mdrOptBOOLEAN.getString( "IS_AUTOINCREMENT" ), equalTo( "" ) );
}
@@ -2797,7 +2780,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_IS_AUTOINCREMENT_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 23 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 23 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2805,12 +2789,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 23 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_IS_AUTOINCREMENT_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 23 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
@@ -2836,7 +2820,7 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_IS_GENERATEDCOLUMN_hasRightValue_mdrOptBOOLEAN() throws SQLException {
- // TODO: Can is be 'NO' (not auto-increment) rather than '' (unknown)?
+ // TODO: Can it be 'NO' (not auto-increment) rather than '' (unknown)?
assertThat( mdrOptBOOLEAN.getString( "IS_GENERATEDCOLUMN" ), equalTo( "" ) );
}
@@ -2849,7 +2833,8 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
@Test
public void test_IS_GENERATEDCOLUMN_hasRightTypeString() throws SQLException {
- assertThat( rowsMetadata.getColumnTypeName( 24 ), equalTo( "VARCHAR" ) );
+ assertThat( rowsMetadata.getColumnTypeName( 24 ),
+ equalTo( "CHARACTER VARYING" ) );
}
@Test
@@ -2857,12 +2842,12 @@ public class DatabaseMetaDataGetColumnsTest extends JdbcTestBase {
assertThat( rowsMetadata.getColumnType( 24 ), equalTo( Types.VARCHAR ) );
}
- @Ignore( "until fixed (\"none\" -> right class name) (DRILL-2137)" )
@Test
public void test_IS_GENERATEDCOLUMN_hasRightClass() throws SQLException {
- // TODO: Confirm that this "java.lang.String" is correct:
+ // TODO(DRILL-3347): Resolve which type(s) to test for:
assertThat( rowsMetadata.getColumnClassName( 24 ),
- equalTo( String.class.getName() ) );
+ anyOf( equalTo( String.class.getName() ),
+ equalTo( org.apache.hadoop.io.Text.class.getName() ) ) );
}
@Test
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillColumnMetaDataListTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillColumnMetaDataListTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillColumnMetaDataListTest.java
index a4571c7..9e332a5 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillColumnMetaDataListTest.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillColumnMetaDataListTest.java
@@ -20,6 +20,7 @@ package org.apache.drill.jdbc;
import net.hydromatic.avatica.ColumnMetaData;
import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.common.types.TypeProtos.DataMode;
import org.apache.drill.exec.record.BatchSchema;
import org.apache.drill.exec.record.MaterializedField;
import org.apache.drill.jdbc.impl.DrillColumnMetaDataList;
@@ -30,7 +31,9 @@ import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import static org.apache.drill.common.types.TypeProtos.MajorType;
import static org.apache.drill.common.types.TypeProtos.MinorType;
@@ -67,13 +70,15 @@ public class DrillColumnMetaDataListTest {
// Create mock columns
final MaterializedField exampleIntField = mock(MaterializedField.class);
MajorType exampleIntType = MajorType.newBuilder().setMinorType(MinorType.INT).build();
- when(exampleIntField.getAsSchemaPath()).thenReturn(SchemaPath.getSimplePath("/path/to/testInt"));
+ when(exampleIntField.getPath()).thenReturn(SchemaPath.getSimplePath("/path/to/testInt"));
when(exampleIntField.getType()).thenReturn(exampleIntType);
+ when(exampleIntField.getDataMode()).thenReturn(DataMode.OPTIONAL);
final MaterializedField exampleStringField = mock(MaterializedField.class);
MajorType exampleStringType = MajorType.newBuilder().setMinorType(MinorType.VARCHAR).build();
- when(exampleStringField.getAsSchemaPath()).thenReturn(SchemaPath.getSimplePath("/path/to/testString"));
+ when(exampleStringField.getPath()).thenReturn(SchemaPath.getSimplePath("/path/to/testString"));
when(exampleStringField.getType()).thenReturn(exampleStringType);
+ when(exampleStringField.getDataMode()).thenReturn(DataMode.REQUIRED);
oneElementList = new DrillColumnMetaDataList();
BatchSchema oneElementSchema = mock(BatchSchema.class);
@@ -91,7 +96,10 @@ public class DrillColumnMetaDataListTest {
}
}
).when(oneElementSchema).getColumn(Mockito.anyInt());
- oneElementList.updateColumnMetaData("testCatalog", "testSchema", "testTable", oneElementSchema);
+ List<Class<?>> oneClassList = new ArrayList<>();
+ oneClassList.add(Integer.class);
+ oneElementList.updateColumnMetaData("testCatalog", "testSchema", "testTable",
+ oneElementSchema, oneClassList);
twoElementList = new DrillColumnMetaDataList();
BatchSchema twoElementSchema = mock(BatchSchema.class);
@@ -111,7 +119,11 @@ public class DrillColumnMetaDataListTest {
}
}
).when(twoElementSchema).getColumn(Mockito.anyInt());
- twoElementList.updateColumnMetaData("testCatalog", "testSchema", "testTable", twoElementSchema);
+ List<Class<?>> twoClassList = new ArrayList<>();
+ twoClassList.add(Integer.class);
+ twoClassList.add(String.class);
+ twoElementList.updateColumnMetaData("testCatalog", "testSchema", "testTable",
+ twoElementSchema, twoClassList);
}
@After
http://git-wip-us.apache.org/repos/asf/drill/blob/80835082/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetGetMethodConversionsTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetGetMethodConversionsTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetGetMethodConversionsTest.java
index 1c528f9..0451c35 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetGetMethodConversionsTest.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/ResultSetGetMethodConversionsTest.java
@@ -78,12 +78,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
+ "SELECT "
+ "\n"
+ "\n TRUE AS C_BOOLEAN_TRUE, "
- // Disabled until TINYINT/SMALLINT are implemented (DRILL-2470):
+ // TODO(DRILL-2470): Uncomment when TINYINT is implemented:
//+ "\n CAST( 1 AS TINYINT ) AS C_TINYINT_1, "
+ // TODO(DRILL-2470): Uncomment when SMALLINT is implemented:
//+ "\n CAST( 2 AS SMALLINT ) AS C_SMALLINT_2, "
+ "\n CAST( 3 AS INTEGER ) AS C_INTEGER_3, "
+ "\n CAST( 4 AS BIGINT ) AS C_BIGINT_4, "
- // Disabled until REAL is implemented (DRILL-2683):
+ // TODO(DRILL-2683): Uncomment when REAL is implemented:
//+ "\n CAST( 5.5 AS REAL ) AS `C_REAL_5.5`, "
+ "\n CAST( 6.6 AS DOUBLE PRECISION ) AS `C_DOUBLE_PREC._6.6`, "
+ "\n CAST( 7.7 AS FLOAT ) AS `C_FLOAT_7.7`, "
@@ -114,13 +115,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - ROWID;
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getByte_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getByte( "C_TINYINT_1" ), equalTo( (byte) 1 ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getByte_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getByte( "C_SMALLINT_2" ), equalTo( (byte) 2 ) );
@@ -136,7 +137,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getByte( "C_BIGINT_4" ), equalTo( (byte) 4 ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getByte_handles_REAL() throws SQLException {
assertThat( testDataRow.getByte( "C_REAL_5.5" ), equalTo( (byte) 5 ) );
@@ -165,13 +166,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getShort_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getShort( "C_TINYINT_1" ), equalTo( (short) 1 ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getShort_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getShort( "C_SMALLINT_2" ), equalTo( (short) 2 ) );
@@ -187,7 +188,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getShort( "C_BIGINT_4" ), equalTo( (short) 4 ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getShort_handles_REAL() throws SQLException {
assertThat( testDataRow.getShort( "C_REAL_5.5" ), equalTo( (short) 5 ) );
@@ -217,13 +218,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getInt_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getInt( "C_TINYINT_1" ), equalTo( 1 ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getInt_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getInt( "C_SMALLINT_2" ), equalTo( 2 ) );
@@ -239,7 +240,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getInt( "C_BIGINT_4" ), equalTo( 4 ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getInt_handles_REAL() throws SQLException {
assertThat( testDataRow.getInt( "C_REAL_5.5" ), equalTo( 5 ) );
@@ -268,13 +269,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getLong_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getLong( "C_TINYINT_1" ), equalTo( 1L ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getLong_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getLong( "C_SMALLINT_2" ), equalTo( 2L ) );
@@ -290,7 +291,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getLong( "C_BIGINT_4" ), equalTo( 4L ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getLong_handles_REAL() throws SQLException {
assertThat( testDataRow.getLong( "C_REAL_5.5" ), equalTo( 5L ) );
@@ -319,13 +320,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getFloat_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getFloat( "C_TINYINT_1" ), equalTo( 1f ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getFloat_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getFloat( "C_SMALLINT_2" ), equalTo( 2f ) );
@@ -341,7 +342,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getFloat( "C_BIGINT_4" ), equalTo( 4f ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getFloat_handles_REAL() throws SQLException {
assertThat( testDataRow.getFloat( "C_REAL_5.5" ), equalTo( 5.5f ) );
@@ -359,7 +360,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
@Test
public void test_getFloat_handles_DECIMAL() throws SQLException {
- assertThat( testDataRow.getFloat( "C_DECIMAL_10.10" ), equalTo( 10.10f ) ); //?????
+ assertThat( testDataRow.getFloat( "C_DECIMAL_10.10" ), equalTo( 10.10f ) );
}
////////////////////////////////////////
@@ -369,13 +370,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getDouble_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getDouble( "C_TINYINT_1" ), equalTo( 1D ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getDouble_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getDouble( "C_SMALLINT_2" ), equalTo( 2D ) );
@@ -391,7 +392,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getDouble( "C_BIGINT_4" ), equalTo( 4D ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getDouble_handles_REAL() throws SQLException {
assertThat( testDataRow.getDouble( "C_REAL_5.5" ), equalTo( (double) 5.5f ) );
@@ -409,7 +410,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
@Test
public void test_getDouble_handles_DECIMAL() throws SQLException {
- assertThat( testDataRow.getDouble( "C_DECIMAL_10.10" ), equalTo( 10.10d ) ); //???
+ assertThat( testDataRow.getDouble( "C_DECIMAL_10.10" ), equalTo( 10.10d ) );
}
////////////////////////////////////////
@@ -419,13 +420,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - CHAR, VARCHAR, LONGVARCHAR;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getBigDecimal_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_TINYINT_1" ), equalTo( new BigDecimal( 1 ) ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getBigDecimal_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_SMALLINT_2" ), equalTo( new BigDecimal( 2 ) ) );
@@ -441,7 +442,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getBigDecimal( "C_BIGINT_4" ), equalTo( new BigDecimal( 4 ) ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getBigDecimal_handles_REAL() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_REAL_5.5" ), equalTo( new BigDecimal( 5.5f ) ) );
@@ -462,10 +463,10 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getBigDecimal( "C_DECIMAL_10.5" ), equalTo( new BigDecimal( "10.5") ) );
}
- @Ignore( "until DECIMAL is supported (no longer maps to double) (DRILL-????)" )
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
@Test
public void test_getBigDecimal_handles_DECIMAL_2() throws SQLException {
- assertThat( testDataRow.getBigDecimal( "C_DECIMAL_10.10" ), equalTo( new BigDecimal( "10.10") ) ); //??????resolve
+ assertThat( testDataRow.getBigDecimal( "C_DECIMAL_10.10" ), equalTo( new BigDecimal( "10.10") ) );
}
@@ -487,13 +488,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - DATALINK;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getString_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getString( "C_TINYINT_1" ), equalTo( "1" ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getString_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getString( "C_SMALLINT_2" ), equalTo( "2" ) );
@@ -509,7 +510,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getString( "C_BIGINT_4" ), equalTo( "4" ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getString_handles_REAL() throws SQLException {
assertThat( testDataRow.getString( "C_REAL_5.5" ), equalTo( "5.5????" ) );
@@ -646,13 +647,13 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
// - JAVA_OBJECT;
//
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when TINYINT is implemented" )
@Test
public void test_getObject_handles_TINYINT() throws SQLException {
assertThat( testDataRow.getObject( "C_TINYINT_1" ), equalTo( (Object) 1 ) );
}
- @Ignore( "until TINYINT/SMALLINT implemented (DRILL-2470)" )
+ @Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" )
@Test
public void test_getObject_handles_SMALLINT() throws SQLException {
assertThat( testDataRow.getObject( "C_SMALLINT_2" ), equalTo( (Object) 2 ) );
@@ -668,7 +669,7 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getObject( "C_BIGINT_4" ), equalTo( (Object) 4L ) );
}
- @Ignore( "until REAL is implemented (DRILL-2683)" )
+ @Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getObject_handles_REAL() throws SQLException {
assertThat( testDataRow.getObject( "C_REAL_5.5" ), equalTo( (Object) 5.5f ) );
@@ -684,14 +685,14 @@ public class ResultSetGetMethodConversionsTest extends JdbcTestBase {
assertThat( testDataRow.getObject( "C_FLOAT_7.7" ), equalTo( (Object) 7.7f ) );
}
- @Ignore( "until DECIMAL is supported (no longer maps to double) (DRILL-????)" )
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
@Test
public void test_getObject_handles_DECIMAL_1() throws SQLException {
assertThat( testDataRow.getObject( "C_DECIMAL_10.5" ),
equalTo( (Object) new BigDecimal( "10.5" ) ) );
}
- @Ignore( "until DECIMAL is supported (no longer maps to double) (DRILL-????)" )
+ @Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
@Test
public void test_getObject_handles_DECIMAL_2() throws SQLException {
assertThat( testDataRow.getObject( "C_DECIMAL_10.10" ),