@Test public void testDDL() { assertFalse(HiveUtil.isTokDDL("")); assertTrue(HiveUtil.isTokDDL("create table abc")); assertTrue(HiveUtil.isTokDDL("alter table abc")); assertFalse(HiveUtil.isTokDDL("select * from abc")); assertFalse(HiveUtil.isTokDDL(null)); }
public static boolean isTokDDL(String sql) { if (org.apache.commons.lang3.StringUtils.isEmpty(sql)) { return false; } String tmp = sql.toUpperCase(); if (tmp.startsWith("CREATE") || tmp.startsWith("DROP") || tmp.startsWith("ALTER")) { return true; } return false; }
HiveUtil extends BaseDao { public static boolean isTokDDL(String sql) { if (org.apache.commons.lang3.StringUtils.isEmpty(sql)) { return false; } String tmp = sql.toUpperCase(); if (tmp.startsWith("CREATE") || tmp.startsWith("DROP") || tmp.startsWith("ALTER")) { return true; } return false; } }
HiveUtil extends BaseDao { public static boolean isTokDDL(String sql) { if (org.apache.commons.lang3.StringUtils.isEmpty(sql)) { return false; } String tmp = sql.toUpperCase(); if (tmp.startsWith("CREATE") || tmp.startsWith("DROP") || tmp.startsWith("ALTER")) { return true; } return false; }  }
HiveUtil extends BaseDao { public static boolean isTokDDL(String sql) { if (org.apache.commons.lang3.StringUtils.isEmpty(sql)) { return false; } String tmp = sql.toUpperCase(); if (tmp.startsWith("CREATE") || tmp.startsWith("DROP") || tmp.startsWith("ALTER")) { return true; } return false; }  @Override void init(); static String getTmpTableName(int projectId, int execId); static String getORCTmpTableDDL(String dbName, String tableName,
      List<HqlColumn> hqlColumnList, String localtion); static String getTmpTableDDL(String dbName, String tableName,
      List<HqlColumn> hqlColumnList, String localtion, String fieldDelimiter, String fileCode); static boolean isTokQuery(String sql); static boolean isTokDDL(String sql); static boolean isLikeShowStm(String sql); HiveService2Client getHiveService2Client(); HiveMetaPoolClient getHiveMetaPoolClient(); HiveService2ConnectionInfo getHiveService2ConnectionInfo(String userName); }
HiveUtil extends BaseDao { public static boolean isTokDDL(String sql) { if (org.apache.commons.lang3.StringUtils.isEmpty(sql)) { return false; } String tmp = sql.toUpperCase(); if (tmp.startsWith("CREATE") || tmp.startsWith("DROP") || tmp.startsWith("ALTER")) { return true; } return false; }  @Override void init(); static String getTmpTableName(int projectId, int execId); static String getORCTmpTableDDL(String dbName, String tableName,
      List<HqlColumn> hqlColumnList, String localtion); static String getTmpTableDDL(String dbName, String tableName,
      List<HqlColumn> hqlColumnList, String localtion, String fieldDelimiter, String fileCode); static boolean isTokQuery(String sql); static boolean isTokDDL(String sql); static boolean isLikeShowStm(String sql); HiveService2Client getHiveService2Client(); HiveMetaPoolClient getHiveMetaPoolClient(); HiveService2ConnectionInfo getHiveService2ConnectionInfo(String userName); static final int DEFAULT_QUERY_PROGRESS_THREAD_TIMEOUT; }