@Test public void testGenerateInsertSql() throws IOException { String sqls = JoinedFlatTable.generateInsertDataStatement(flatTableDesc); System.out.println(sqls); int length = sqls.length(); assertEquals(1437, length); }
public static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc) { CubeSegment segment = ((CubeSegment) flatDesc.getSegment()); KylinConfig kylinConfig; if (null == segment) { kylinConfig = KylinConfig.getInstanceFromEnv(); } else { kylinConfig = (flatDesc.getSegment()).getConfig(); } if (kylinConfig.isAdvancedFlatTableUsed()) { try { Class advancedFlatTable = Class.forName(kylinConfig.getAdvancedFlatTableClass()); Method method = advancedFlatTable.getMethod("generateInsertDataStatement", IJoinedFlatTableDesc.class, JobEngineConfig.class); return (String) method.invoke(null, flatDesc); } catch (Exception e) { throw new RuntimeException(e); } } return "INSERT OVERWRITE TABLE " + quoteIdentifier(flatDesc.getTableName(), null) + " " + generateSelectDataStatement(flatDesc) + ";\n"; }
JoinedFlatTable { public static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc) { CubeSegment segment = ((CubeSegment) flatDesc.getSegment()); KylinConfig kylinConfig; if (null == segment) { kylinConfig = KylinConfig.getInstanceFromEnv(); } else { kylinConfig = (flatDesc.getSegment()).getConfig(); } if (kylinConfig.isAdvancedFlatTableUsed()) { try { Class advancedFlatTable = Class.forName(kylinConfig.getAdvancedFlatTableClass()); Method method = advancedFlatTable.getMethod("generateInsertDataStatement", IJoinedFlatTableDesc.class, JobEngineConfig.class); return (String) method.invoke(null, flatDesc); } catch (Exception e) { throw new RuntimeException(e); } } return "INSERT OVERWRITE TABLE " + quoteIdentifier(flatDesc.getTableName(), null) + " " + generateSelectDataStatement(flatDesc) + ";\n"; } }
JoinedFlatTable { public static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc) { CubeSegment segment = ((CubeSegment) flatDesc.getSegment()); KylinConfig kylinConfig; if (null == segment) { kylinConfig = KylinConfig.getInstanceFromEnv(); } else { kylinConfig = (flatDesc.getSegment()).getConfig(); } if (kylinConfig.isAdvancedFlatTableUsed()) { try { Class advancedFlatTable = Class.forName(kylinConfig.getAdvancedFlatTableClass()); Method method = advancedFlatTable.getMethod("generateInsertDataStatement", IJoinedFlatTableDesc.class, JobEngineConfig.class); return (String) method.invoke(null, flatDesc); } catch (Exception e) { throw new RuntimeException(e); } } return "INSERT OVERWRITE TABLE " + quoteIdentifier(flatDesc.getTableName(), null) + " " + generateSelectDataStatement(flatDesc) + ";\n"; }  }
JoinedFlatTable { public static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc) { CubeSegment segment = ((CubeSegment) flatDesc.getSegment()); KylinConfig kylinConfig; if (null == segment) { kylinConfig = KylinConfig.getInstanceFromEnv(); } else { kylinConfig = (flatDesc.getSegment()).getConfig(); } if (kylinConfig.isAdvancedFlatTableUsed()) { try { Class advancedFlatTable = Class.forName(kylinConfig.getAdvancedFlatTableClass()); Method method = advancedFlatTable.getMethod("generateInsertDataStatement", IJoinedFlatTableDesc.class, JobEngineConfig.class); return (String) method.invoke(null, flatDesc); } catch (Exception e) { throw new RuntimeException(e); } } return "INSERT OVERWRITE TABLE " + quoteIdentifier(flatDesc.getTableName(), null) + " " + generateSelectDataStatement(flatDesc) + ";\n"; }  static String getTableDir(IJoinedFlatTableDesc flatDesc, String storageDfsDir); static String generateHiveInitStatements(String flatTableDatabase); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir,
            String storageFormat); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir,
            String storageFormat, String fieldDelimiter); static String generateDropTableStatement(IJoinedFlatTableDesc flatDesc); static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc); static String generateSelectDataStatement(IJoinedFlatTableDesc flatDesc); static String generateSelectDataStatement(IJoinedFlatTableDesc flatDesc, boolean singleLine,
                                                     String[] skipAs, SqlDialect sqlDialect); static String colName(TblColRef col); static String colName(TblColRef col, boolean useAlias); static String generateRedistributeFlatTableStatement(IJoinedFlatTableDesc flatDesc, CubeDesc cubeDesc); static String getQuotedColExpressionInSourceDB(IJoinedFlatTableDesc flatDesc, TblColRef col, SqlDialect sqlDialect); }
JoinedFlatTable { public static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc) { CubeSegment segment = ((CubeSegment) flatDesc.getSegment()); KylinConfig kylinConfig; if (null == segment) { kylinConfig = KylinConfig.getInstanceFromEnv(); } else { kylinConfig = (flatDesc.getSegment()).getConfig(); } if (kylinConfig.isAdvancedFlatTableUsed()) { try { Class advancedFlatTable = Class.forName(kylinConfig.getAdvancedFlatTableClass()); Method method = advancedFlatTable.getMethod("generateInsertDataStatement", IJoinedFlatTableDesc.class, JobEngineConfig.class); return (String) method.invoke(null, flatDesc); } catch (Exception e) { throw new RuntimeException(e); } } return "INSERT OVERWRITE TABLE " + quoteIdentifier(flatDesc.getTableName(), null) + " " + generateSelectDataStatement(flatDesc) + ";\n"; }  static String getTableDir(IJoinedFlatTableDesc flatDesc, String storageDfsDir); static String generateHiveInitStatements(String flatTableDatabase); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir,
            String storageFormat); static String generateCreateTableStatement(IJoinedFlatTableDesc flatDesc, String storageDfsDir,
            String storageFormat, String fieldDelimiter); static String generateDropTableStatement(IJoinedFlatTableDesc flatDesc); static String generateInsertDataStatement(IJoinedFlatTableDesc flatDesc); static String generateSelectDataStatement(IJoinedFlatTableDesc flatDesc); static String generateSelectDataStatement(IJoinedFlatTableDesc flatDesc, boolean singleLine,
                                                     String[] skipAs, SqlDialect sqlDialect); static String colName(TblColRef col); static String colName(TblColRef col, boolean useAlias); static String generateRedistributeFlatTableStatement(IJoinedFlatTableDesc flatDesc, CubeDesc cubeDesc); static String getQuotedColExpressionInSourceDB(IJoinedFlatTableDesc flatDesc, TblColRef col, SqlDialect sqlDialect); static final String TEXTFILE; static final String SEQUENCEFILE; }