@ Override public List < String > generateQueries ( ) { ensureParentOfStagingPathExists ( ) ; List < String > hiveQueries = Lists . newArrayList ( ) ; /* * Setting partition mode to 'nonstrict' is needed to improve readability of the code. * If we do not set dynamic partition mode to nonstrict, we will have to write partition values also, * and because hive considers partition as a virtual column, we also have to write each of the column * name in the query (in place of *) to match source and target columns. */ hiveQueries . add ( "SET hive.exec.dynamic.partition.mode=nonstrict" ) ; Preconditions . checkNotNull ( this . workUnit , "Workunit must not be null" ) ; EventWorkunitUtils . setBeginDDLBuildTimeMetadata ( this . workUnit , System . currentTimeMillis ( ) ) ; HiveConverterUtils . createStagingDirectory ( fs , outputTableMetadata . getDestinationDataPath ( ) , conversionEntity , this . workUnitState ) ; // Create DDL statement for table String createStagingTableDDL = HiveConverterUtils . generateCreateDuplicateTableDDL ( inputDbName , inputTableName , stagingTableName , stagingDataLocation , Optional . of ( outputDatabaseName ) ) ; hiveQueries . add ( createStagingTableDDL ) ; log . debug ( "Create staging table DDL:\n" + createStagingTableDDL ) ; String insertInStagingTableDML = HiveConverterUtils . generateTableCopy ( inputTableName , stagingTableName , conversionEntity . getTable ( ) . getDbName ( ) , outputDatabaseName , Optional . of ( partitionsDMLInfo ) ) ; hiveQueries . add ( insertInStagingTableDML ) ; log . debug ( "Conversion staging DML: " + insertInStagingTableDML ) ; log . info ( "Conversion Queries {}\n" , hiveQueries ) ; EventWorkunitUtils . setEndDDLBuildTimeMetadata ( workUnit , System . currentTimeMillis ( ) ) ; return hiveQueries ; }
Returns hive queries to be run as a part of a hive task . This does not include publish queries .