protected Path getStagingPathRoot(ConnectorOutputTableHandle outputTableHandle) { HiveOutputTableHandle handle = (HiveOutputTableHandle) outputTableHandle; return getLocationService() .getQueryWriteInfo(handle.getLocationHandle()) .getWritePath(); }
protected Path getStagingPathRoot(ConnectorInsertTableHandle insertTableHandle) { HiveInsertTableHandle handle = (HiveInsertTableHandle) insertTableHandle; WriteInfo writeInfo = getLocationService().getQueryWriteInfo(handle.getLocationHandle()); if (writeInfo.getWriteMode() != STAGE_AND_MOVE_TO_TARGET_DIRECTORY) { throw new AssertionError("writeMode is not STAGE_AND_MOVE_TO_TARGET_DIRECTORY"); } return writeInfo.getWritePath(); }
protected Path getTargetPathRoot(ConnectorInsertTableHandle insertTableHandle) { HiveInsertTableHandle hiveInsertTableHandle = (HiveInsertTableHandle) insertTableHandle; return getLocationService() .getQueryWriteInfo(hiveInsertTableHandle.getLocationHandle()) .getTargetPath(); }
protected String partitionTargetPath(SchemaTableName schemaTableName, String partitionName) { try (Transaction transaction = newTransaction()) { ConnectorSession session = newSession(); SemiTransactionalHiveMetastore metastore = transaction.getMetastore(schemaTableName.getSchemaName()); LocationService locationService = getLocationService(); Table table = metastore.getTable(schemaTableName.getSchemaName(), schemaTableName.getTableName()).get(); LocationHandle handle = locationService.forExistingTable(metastore, session, table); return locationService.getPartitionWriteInfo(handle, Optional.empty(), partitionName).getTargetPath().toString(); } }
try { try (Transaction transaction = newTransaction()) { LocationService locationService = getLocationService(); LocationHandle locationHandle = locationService.forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath();
String tableName = schemaTableName.getTableName(); LocationService locationService = getLocationService(); LocationHandle locationHandle = locationService.forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath();
protected Set<String> listAllDataFiles(ConnectorOutputTableHandle tableHandle) throws IOException { HiveOutputTableHandle hiveOutputTableHandle = (HiveOutputTableHandle) tableHandle; Path writePath = new Path(getLocationService(hiveOutputTableHandle.getSchemaName()).writePathRoot(hiveOutputTableHandle.getLocationHandle()).get().toString()); return listAllDataFiles(writePath); }
protected Set<String> listAllDataFiles(ConnectorInsertTableHandle tableHandle) throws IOException { HiveInsertTableHandle hiveInsertTableHandle = (HiveInsertTableHandle) tableHandle; Path writePath = new Path(getLocationService(hiveInsertTableHandle.getSchemaName()).writePathRoot(hiveInsertTableHandle.getLocationHandle()).get().toString()); return listAllDataFiles(writePath); }
protected Path getStagingPathRoot(ConnectorOutputTableHandle outputTableHandle) { HiveOutputTableHandle handle = (HiveOutputTableHandle) outputTableHandle; return getLocationService() .getQueryWriteInfo(handle.getLocationHandle()) .getWritePath(); }
protected Path getStagingPathRoot(ConnectorInsertTableHandle insertTableHandle) { HiveInsertTableHandle handle = (HiveInsertTableHandle) insertTableHandle; WriteInfo writeInfo = getLocationService().getQueryWriteInfo(handle.getLocationHandle()); if (writeInfo.getWriteMode() != STAGE_AND_MOVE_TO_TARGET_DIRECTORY) { throw new AssertionError("writeMode is not STAGE_AND_MOVE_TO_TARGET_DIRECTORY"); } return writeInfo.getWritePath(); }
protected Path getTargetPathRoot(ConnectorInsertTableHandle insertTableHandle) { HiveInsertTableHandle hiveInsertTableHandle = (HiveInsertTableHandle) insertTableHandle; return getLocationService() .getQueryWriteInfo(hiveInsertTableHandle.getLocationHandle()) .getTargetPath(); }
protected String partitionTargetPath(SchemaTableName schemaTableName, String partitionName) { try (Transaction transaction = newTransaction()) { ConnectorSession session = newSession(); SemiTransactionalHiveMetastore metastore = transaction.getMetastore(schemaTableName.getSchemaName()); LocationService locationService = getLocationService(); Table table = metastore.getTable(schemaTableName.getSchemaName(), schemaTableName.getTableName()).get(); LocationHandle handle = locationService.forExistingTable(metastore, session, table); return locationService.getPartitionWriteInfo(handle, Optional.empty(), partitionName).getTargetPath().toString(); } }
try { try (Transaction transaction = newTransaction()) { LocationService locationService = getLocationService(); LocationHandle locationHandle = locationService.forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath();
String tableName = schemaTableName.getTableName(); LocationService locationService = getLocationService(); LocationHandle locationHandle = locationService.forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath();
String tableName = schemaTableName.getTableName(); LocationService locationService = getLocationService(schemaName); LocationHandle locationHandle = locationService.forNewTable(session.getQueryId(), schemaName, tableName); Path targetPath = locationService.targetPathRoot(locationHandle);