org.apache.hadoop.hive.ql.metadata.Table.setOutputFormatClass()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Table.setOutputFormatClass()方法的一些代码示例,展示了Table.setOutputFormatClass()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setOutputFormatClass()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Table
类名称:Table
方法名:setOutputFormatClass

Table.setOutputFormatClass介绍

暂无

代码示例

代码示例来源:origin: apache/hive

  1. public void setOutputFormatClass(String name) throws HiveException {
  2. if (name == null) {
  3. outputFormatClass = null;
  4. tTable.getSd().setOutputFormat(null);
  5. return;
  6. }
  7. try {
  8. Class<?> origin = Class.forName(name, true, Utilities.getSessionSpecifiedClassLoader());
  9. setOutputFormatClass(HiveFileFormatUtils.getOutputFormatSubstitute(origin));
  10. } catch (ClassNotFoundException e) {
  11. throw new HiveException("Class not found: " + name, e);
  12. }
  13. }

代码示例来源:origin: apache/drill

  1. public void setOutputFormatClass(String name) throws HiveException {
  2. if (name == null) {
  3. outputFormatClass = null;
  4. tTable.getSd().setOutputFormat(null);
  5. return;
  6. }
  7. try {
  8. Class<?> origin = Class.forName(name, true, Utilities.getSessionSpecifiedClassLoader());
  9. setOutputFormatClass(HiveFileFormatUtils.getOutputFormatSubstitute(origin));
  10. } catch (ClassNotFoundException e) {
  11. throw new HiveException("Class not found: " + name, e);
  12. }
  13. }

代码示例来源:origin: apache/hive

  1. private static Table createTestTable(String dbName, String tableName) throws HiveException {
  2. Table tbl = new Table(dbName, tableName);
  3. tbl.setInputFormatClass(SequenceFileInputFormat.class.getName());
  4. tbl.setOutputFormatClass(SequenceFileOutputFormat.class.getName());
  5. tbl.setSerializationLib(ThriftDeserializer.class.getName());
  6. tbl.setSerdeParam(serdeConstants.SERIALIZATION_CLASS, Complex.class.getName());
  7. tbl.setSerdeParam(serdeConstants.SERIALIZATION_FORMAT, TBinaryProtocol.class
  8. .getName());
  9. return tbl;
  10. }

代码示例来源:origin: apache/hive

  1. protected Table getDummyTable() throws SemanticException {
  2. Path dummyPath = createDummyFile();
  3. Table desc = new Table(DUMMY_DATABASE, DUMMY_TABLE);
  4. desc.getTTable().getSd().setLocation(dummyPath.toString());
  5. desc.getTTable().getSd().getSerdeInfo().setSerializationLib(NullStructSerDe.class.getName());
  6. desc.setInputFormatClass(NullRowsInputFormat.class);
  7. desc.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  8. return desc;
  9. }

代码示例来源:origin: apache/drill

  1. private Table getDummyTable() throws SemanticException {
  2. Path dummyPath = createDummyFile();
  3. Table desc = new Table(DUMMY_DATABASE, DUMMY_TABLE);
  4. desc.getTTable().getSd().setLocation(dummyPath.toString());
  5. desc.getTTable().getSd().getSerdeInfo().setSerializationLib(NullStructSerDe.class.getName());
  6. desc.setInputFormatClass(NullRowsInputFormat.class);
  7. desc.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  8. return desc;
  9. }

代码示例来源:origin: apache/hive

  1. table.setStoredAsSubDirectories(false);
  2. table.setInputFormatClass(format.getInputFormat());
  3. table.setOutputFormatClass(format.getOutputFormat());
  4. db.createTable(table, true);

代码示例来源:origin: apache/hive

  1. tbl.setOutputFormatClass(fileOutputFormat.getName());

代码示例来源:origin: apache/drill

  1. tbl.setOutputFormatClass(fileOutputFormat.getName());

代码示例来源:origin: apache/drill

  1. table.setStoredAsSubDirectories(false);
  2. table.setInputFormatClass(format.getInputFormat());
  3. table.setOutputFormatClass(format.getOutputFormat());
  4. db.createTable(table, true);

代码示例来源:origin: apache/hive

  1. table.setDbName(dbName);
  2. table.setInputFormatClass(TextInputFormat.class);
  3. table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);

代码示例来源:origin: apache/hive

  1. tbl.setOutputFormatClass(SequenceFileOutputFormat.class.getName());
  2. tbl.setSerializationLib(ThriftDeserializer.class.getName());
  3. tbl.setSerdeParam(serdeConstants.SERIALIZATION_CLASS, Complex.class.getName());

代码示例来源:origin: apache/hive

  1. @Test
  2. public void testDataDeletion() throws HiveException,
  3. IOException, TException {
  4. Database db = new Database();
  5. db.setName(dbName);
  6. hive.createDatabase(db);
  7. Table table = new Table(dbName, tableName);
  8. table.setDbName(dbName);
  9. table.setInputFormatClass(TextInputFormat.class);
  10. table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  11. table.setPartCols(partCols);
  12. hive.createTable(table);
  13. table = hive.getTable(dbName, tableName);
  14. Path fakeTable = table.getPath().getParent().suffix(
  15. Path.SEPARATOR + "faketable");
  16. fs = fakeTable.getFileSystem(hive.getConf());
  17. fs.mkdirs(fakeTable);
  18. fs.deleteOnExit(fakeTable);
  19. Path fakePart = new Path(table.getDataLocation().toString(),
  20. "fakepartition=fakevalue");
  21. fs.mkdirs(fakePart);
  22. fs.deleteOnExit(fakePart);
  23. hive.dropTable(dbName, tableName, true, true);
  24. assertFalse(fs.exists(fakePart));
  25. hive.dropDatabase(dbName);
  26. assertFalse(fs.exists(fakeTable));
  27. }

代码示例来源:origin: apache/hive

  1. tbl.setOutputFormatClass(crtTbl.getDefaultOutputFormat());
  2. tbl.setOutputFormatClass(crtTbl.getDefaultOutputFormat());
  3. tbl.getTTable().getSd().setInputFormat(
  4. tbl.getInputFormatClass().getName());

代码示例来源:origin: apache/drill

  1. table.setStoredAsSubDirectories(false);
  2. table.setInputFormatClass(format.getInputFormat());
  3. table.setOutputFormatClass(format.getOutputFormat());
  4. db.createTable(table, false);
  5. } catch (Exception e) {

代码示例来源:origin: apache/hive

  1. tbl.setOutputFormatClass(getOutputFormat());
  2. tbl.setOutputFormatClass(getOutputFormat());
  3. if (getInputFormat() != null && !getInputFormat().isEmpty()) {
  4. tbl.getSd().setInputFormat(tbl.getInputFormatClass().getName());

代码示例来源:origin: apache/hive

  1. table.setDbName(dbName);
  2. table.setInputFormatClass(TextInputFormat.class);
  3. table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);

代码示例来源:origin: apache/hive

  1. tbl.setFields(fields);
  2. tbl.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  3. tbl.setInputFormatClass(SequenceFileInputFormat.class);

代码示例来源:origin: apache/hive

  1. private Table createTestTable() throws HiveException, AlreadyExistsException {
  2. Database db = new Database();
  3. db.setName(dbName);
  4. hive.createDatabase(db, true);
  5. Table table = new Table(dbName, tableName);
  6. table.setDbName(dbName);
  7. table.setInputFormatClass(TextInputFormat.class);
  8. table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  9. table.setPartCols(partCols);
  10. hive.createTable(table);
  11. table = hive.getTable(dbName, tableName);
  12. Assert.assertTrue(table.getTTable().isSetId());
  13. table.getTTable().unsetId();
  14. for (Map<String, String> partSpec : parts) {
  15. hive.createPartition(table, partSpec);
  16. }
  17. return table;
  18. }

代码示例来源:origin: apache/hive

  1. oldview.setOutputFormatClass(crtView.getOutputFormat());

代码示例来源:origin: apache/drill

  1. oldview.setOutputFormatClass(crtView.getOutputFormat());
  2. tbl.setOutputFormatClass(crtView.getOutputFormat());

相关文章

Table类方法