Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TestSchemaUtils.java
Go to the documentation of this file.
1 // Copyright (c) 2012 Cloudera, Inc. All rights reserved.
2 
3 package com.cloudera.impala.catalog;
4 
5 import java.util.HashMap;
6 import java.util.Map;
7 
8 public class TestSchemaUtils {
9  // maps from PrimitiveType to column name
10  // in alltypes table
11  private static Map<Type, String> typeToColumnNameMap_ =
12  new HashMap<Type, String>();
13  static {
14  typeToColumnNameMap_.put(Type.BOOLEAN, "bool_col");
15  typeToColumnNameMap_.put(Type.TINYINT, "tinyint_col");
16  typeToColumnNameMap_.put(Type.SMALLINT, "smallint_col");
17  typeToColumnNameMap_.put(Type.INT, "int_col");
18  typeToColumnNameMap_.put(Type.BIGINT, "bigint_col");
19  typeToColumnNameMap_.put(Type.FLOAT, "float_col");
20  typeToColumnNameMap_.put(Type.DOUBLE, "double_col");
21  typeToColumnNameMap_.put(Type.DATE, "date_col");
22  typeToColumnNameMap_.put(Type.DATETIME, "datetime_col");
23  typeToColumnNameMap_.put(Type.TIMESTAMP, "timestamp_col");
24  typeToColumnNameMap_.put(Type.STRING, "string_col");
25  }
26 
27  public static String getComplexTypeTableName(String type) {
28  return type + "_tbl";
29  }
30 
31  public static String getAllTypesColumn(Type type) {
32  return typeToColumnNameMap_.get(type);
33  }
34 }
static String getComplexTypeTableName(String type)
static final ScalarType BIGINT
Definition: Type.java:50
static final ScalarType DATE
Definition: Type.java:56
static final ScalarType STRING
Definition: Type.java:53
static final ScalarType BOOLEAN
Definition: Type.java:46
static final ScalarType SMALLINT
Definition: Type.java:48
static final ScalarType FLOAT
Definition: Type.java:51
static final ScalarType DOUBLE
Definition: Type.java:52
static final ScalarType TINYINT
Definition: Type.java:47
static final ScalarType INT
Definition: Type.java:49
static Map< Type, String > typeToColumnNameMap_
static final ScalarType DATETIME
Definition: Type.java:57
static final ScalarType TIMESTAMP
Definition: Type.java:55