schemaTool.getMetaStoreSchemaInfo().generateInitFileName(version)).getPath(); try { LOG.debug("Parsing schema script " + schemaFile);
@Override void execute() throws HiveMetaException { ensureToVersion(); schemaTool.testConnectionToMetastore(); System.out.println("Starting metastore schema initialization to " + toVersion); String initScriptDir = schemaTool.getMetaStoreSchemaInfo().getMetaStoreScriptDir(); String initScriptFile = schemaTool.getMetaStoreSchemaInfo().generateInitFileName(toVersion); try { System.out.println("Initialization script " + initScriptFile); if (!schemaTool.isDryRun()) { schemaTool.execSql(initScriptDir, initScriptFile); System.out.println("Initialization script completed"); } } catch (IOException e) { throw new HiveMetaException("Schema initialization FAILED! Metastore state would be inconsistent!", e); } if (validate) { schemaTool.verifySchemaVersion(); } } }
/** * Initialize the metastore schema * * @param toVersion * If null then current hive version is used * @throws MetaException */ public void doInit(String toVersion) throws HiveMetaException { testConnectionToMetastore(); System.out.println("Starting metastore schema initialization to " + toVersion); String initScriptDir = metaStoreSchemaInfo.getMetaStoreScriptDir(); String initScriptFile = metaStoreSchemaInfo.generateInitFileName(toVersion); try { System.out.println("Initialization script " + initScriptFile); if (!dryRun) { runBeeLine(initScriptDir, initScriptFile); System.out.println("Initialization script completed"); } } catch (IOException e) { throw new HiveMetaException("Schema initialization FAILED!" + " Metastore state would be inconsistent !!", e); } }
metaStoreSchemaInfo.generateInitFileName(version)).getPath(); try { LOG.debug("Parsing schema script " + schemaFile);