@Test public void testConfigure() throws IOException { BigQueryOutputConfiguration.configure( conf, QUALIFIED_TABLE_ID, TEST_TABLE_SCHEMA, 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)) .isEqualTo(TEST_TABLE_SCHEMA_STRING); assertThat(BigQueryOutputConfiguration.getGcsOutputPath(conf).toString()) .isEqualTo(TEST_OUTPUT_PATH_STRING); }
@SuppressWarnings("rawtypes") public static void configure( Configuration conf, String qualifiedOutputTableId, String outputTableSchemaJson, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { Preconditions.checkArgument( !Strings.isNullOrEmpty(outputTableSchemaJson), "outputTableSchemaJson must not be null or empty."); TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.of(outputTableSchemaJson), outputGcsPath, outputFileFormat, outputFormatClass); }
BigQueryOutputConfiguration { @SuppressWarnings("rawtypes") public static void configure( Configuration conf, String qualifiedOutputTableId, String outputTableSchemaJson, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { Preconditions.checkArgument( !Strings.isNullOrEmpty(outputTableSchemaJson), "outputTableSchemaJson must not be null or empty."); TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.of(outputTableSchemaJson), outputGcsPath, outputFileFormat, outputFormatClass); } }
BigQueryOutputConfiguration { @SuppressWarnings("rawtypes") public static void configure( Configuration conf, String qualifiedOutputTableId, String outputTableSchemaJson, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { Preconditions.checkArgument( !Strings.isNullOrEmpty(outputTableSchemaJson), "outputTableSchemaJson must not be null or empty."); TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.of(outputTableSchemaJson), outputGcsPath, outputFileFormat, outputFormatClass); }  }
BigQueryOutputConfiguration { @SuppressWarnings("rawtypes") public static void configure( Configuration conf, String qualifiedOutputTableId, String outputTableSchemaJson, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { Preconditions.checkArgument( !Strings.isNullOrEmpty(outputTableSchemaJson), "outputTableSchemaJson must not be null or empty."); TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.of(outputTableSchemaJson), 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); }
BigQueryOutputConfiguration { @SuppressWarnings("rawtypes") public static void configure( Configuration conf, String qualifiedOutputTableId, String outputTableSchemaJson, String outputGcsPath, BigQueryFileFormat outputFileFormat, Class<? extends FileOutputFormat> outputFormatClass) throws IOException { Preconditions.checkArgument( !Strings.isNullOrEmpty(outputTableSchemaJson), "outputTableSchemaJson must not be null or empty."); TableReference outputTable = BigQueryStrings.parseTableReference(qualifiedOutputTableId); configure( conf, outputTable.getProjectId(), outputTable.getDatasetId(), outputTable.getTableId(), Optional.of(outputTableSchemaJson), 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; }