BigQueryOutputConfiguration { @SuppressWarnings("rawtypes") public static void configureWithAutoSchema( Configuration conf, String qualifiedOutputTableId, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.empty(), outputGcsPath, outputFileFormat, outputFormatClass); }  @SuppressWarnings("rawtypes") static void configure(
      Configuration conf,
      String qualifiedOutputTableId,
      String outputTableSchemaJson,
      String outputGcsPath,
      BigQueryFileFormat outputFileFormat,
      Class<? extends FileOutputFormat> outputFormatClass); @SuppressWarnings("rawtypes") static void configure(
      Configuration conf,
      String qualifiedOutputTableId,
      BigQueryTableSchema outputTableSchema,
      String outputGcsPath,
      BigQueryFileFormat outputFileFormat,
      Class<? extends FileOutputFormat> outputFormatClass); @SuppressWarnings("rawtypes") static void configureWithAutoSchema(
      Configuration conf,
      String qualifiedOutputTableId,
      String outputGcsPath,
      BigQueryFileFormat outputFileFormat,
      Class<? extends FileOutputFormat> outputFormatClass); static void setKmsKeyName(Configuration conf, String kmsKeyName); static void validateConfiguration(Configuration conf); static boolean getCleanupTemporaryDataFlag(Configuration conf); static String getProjectId(Configuration conf); static String getJobProjectId(Configuration conf); static String getKmsKeyName(Configuration conf); static BigQueryFileFormat getFileFormat(Configuration conf); @SuppressWarnings("rawtypes") static FileOutputFormat getFileOutputFormat(Configuration conf); static Path getGcsOutputPath(Configuration conf); static String getCreateDisposition(Configuration conf); static String getWriteDisposition(Configuration conf); static final List<HadoopConfigurationProperty<?>> REQUIRED_PROPERTIES; }
@Test public void testConfigureWithAutoSchema() throws IOException { BigQueryOutputConfiguration.configureWithAutoSchema( conf, QUALIFIED_TABLE_ID, TEST_OUTPUT_PATH_STRING, TEST_FILE_FORMAT, TEST_OUTPUT_CLASS); assertThat(BigQueryConfiguration.OUTPUT_PROJECT_ID.get(conf, conf::get)) .isEqualTo(TEST_PROJECT_ID); assertThat(BigQueryConfiguration.OUTPUT_DATASET_ID.get(conf, conf::get)) .isEqualTo(TEST_DATASET_ID); assertThat(BigQueryConfiguration.OUTPUT_TABLE_ID.get(conf, conf::get)).isEqualTo(TEST_TABLE_ID); assertThat(BigQueryConfiguration.OUTPUT_FILE_FORMAT.get(conf, conf::get)) .isEqualTo(TEST_FILE_FORMAT.name()); assertThat(BigQueryConfiguration.OUTPUT_FORMAT_CLASS.get(conf, conf::getClass)) .isEqualTo(TEST_OUTPUT_CLASS); assertThat(BigQueryConfiguration.OUTPUT_TABLE_SCHEMA.get(conf, conf::get)).isNull(); assertThat(BigQueryOutputConfiguration.getGcsOutputPath(conf).toString()) .isEqualTo(TEST_OUTPUT_PATH_STRING); }