private static HiveTableDefinition allHiveSimpleTypesParquetTableDefinition() {
   String tableName = "parquet_all_types";
   HiveDataSource dataSource =
       createResourceDataSource(
           tableName,
           "" + System.currentTimeMillis(),
           "com/facebook/presto/tests/hive/data/all_types/data.parquet");
   return HiveTableDefinition.builder()
       .setName(tableName)
       .setCreateTableDDLTemplate(
           ""
               + "CREATE EXTERNAL TABLE %NAME%("
               + "   c_tinyint            TINYINT,"
               + "   c_smallint           SMALLINT,"
               + "   c_int                INT,"
               + "   c_bigint             BIGINT,"
               + "   c_float              FLOAT,"
               + "   c_double             DOUBLE,"
               + "   c_timestamp          TIMESTAMP,"
               + "   c_string             STRING,"
               + "   c_varchar            VARCHAR(10),"
               + "   c_char               CHAR(10),"
               + "   c_boolean            BOOLEAN"
               + ") "
               + "STORED AS PARQUET "
               + "LOCATION '%LOCATION%'")
       .setDataSource(dataSource)
       .build();
 }
 private static HiveTableDefinition allHiveSimpleTypesKnownToPrestoTextfileTableDefinition() {
   String tableName = "textfile_all_types_known_to_presto";
   HiveDataSource dataSource =
       createResourceDataSource(
           tableName,
           "" + System.currentTimeMillis(),
           "com/facebook/presto/tests/hive/data/all_types_known_to_presto/data.textfile");
   return HiveTableDefinition.builder()
       .setName(tableName)
       .setCreateTableDDLTemplate(
           ""
               + "CREATE EXTERNAL TABLE %NAME%("
               + "   c_tinyint            TINYINT,"
               + "   c_smallint           SMALLINT,"
               + "   c_int                INT,"
               + "   c_bigint             BIGINT,"
               + "   c_float              FLOAT,"
               + "   c_double             DOUBLE,"
               + "   c_timestamp          TIMESTAMP,"
               + "   c_date               DATE,"
               + "   c_string             STRING,"
               + "   c_varchar            VARCHAR(10),"
               + "   c_char               CHAR(10),"
               + "   c_boolean            BOOLEAN,"
               + "   c_binary             BINARY"
               + ") "
               + "ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' "
               + "STORED AS TEXTFILE "
               + "LOCATION '%LOCATION%'")
       .setDataSource(dataSource)
       .build();
 }
 private static HiveTableDefinition allHiveSimpleTypesTableDefinition(
     String fileFormat, Optional<String> rowFormat) {
   String tableName = fileFormat.toLowerCase() + "_all_types";
   HiveDataSource dataSource =
       createResourceDataSource(
           tableName,
           "" + System.currentTimeMillis(),
           "com/facebook/presto/tests/hive/data/all_types/data." + fileFormat.toLowerCase());
   return HiveTableDefinition.builder()
       .setName(tableName)
       .setCreateTableDDLTemplate(
           ""
               + "CREATE EXTERNAL TABLE %NAME%("
               + "   c_tinyint            TINYINT,"
               + "   c_smallint           SMALLINT,"
               + "   c_int                INT,"
               + "   c_bigint             BIGINT,"
               + "   c_float              FLOAT,"
               + "   c_double             DOUBLE,"
               + "   c_decimal            DECIMAL,"
               + "   c_decimal_w_params   DECIMAL(10,5),"
               + "   c_timestamp          TIMESTAMP,"
               + "   c_date               DATE,"
               + "   c_string             STRING,"
               + "   c_varchar            VARCHAR(10),"
               + "   c_char               CHAR(10),"
               + "   c_boolean            BOOLEAN,"
               + "   c_binary             BINARY"
               + ") "
               + (rowFormat.isPresent() ? "ROW FORMAT " + rowFormat.get() + " " : " ")
               + "STORED AS "
               + fileFormat
               + " "
               + "LOCATION '%LOCATION%'")
       .setDataSource(dataSource)
       .build();
 }