code: public static WorkUnit queryResultMaterializationWorkUnit(String query, HiveConverterUtils.StorageFormat storageFormat,
        StageableTableMetadata destinationTable) {
      WorkUnit workUnit = new WorkUnit();
      workUnit.setProp(MATERIALIZER_MODE_KEY, MaterializerMode.QUERY_RESULT_MATERIALIZATION.name());
      workUnit.setProp(STORAGE_FORMAT_KEY, storageFormat.name());
      workUnit.setProp(QUERY_RESULT_TO_MATERIALIZE_KEY, query);
      workUnit.setProp(STAGEABLE_TABLE_METADATA_KEY, HiveSource.GENERICS_AWARE_GSON.toJson(destinationTable));
      TaskUtils.setTaskFactoryClass(workUnit, HiveMaterializerTaskFactory.class);
      HiveTask.disableHiveWatermarker(workUnit);
      return workUnit;
    }
docs: Create a work unit to materialize a query to a target table using a staging table in between.
  @param query the query to materialize.
  @param storageFormat format in which target table should be written.
  @param destinationTable {@link StageableTableMetadata} specifying staging and target tables metadata.