java/hybridse-sdk/src/main/java/com/_4paradigm/hybridse/sdk/SqlEngine.java
public void initilize(String sql, List<TypeOuterClass.Database> databases, EngineOptions engineOptions,
                          String defaultDbName)
            throws UnsupportedHybridSeException {
        options = engineOptions;
        catalog = new SimpleCatalog();
        session = new BatchRunSession();
        for (TypeOuterClass.Database database: databases) {
            catalog.AddDatabase(database);
        }
        engine = new Engine(catalog, options);

        BaseStatus status = new BaseStatus();
        boolean ok = engine.Get(sql, Objects.isNull(defaultDbName) ? "" : defaultDbName, session, status);
        if (!(ok && status.getMsg().equals("ok"))) {
            throw new UnsupportedHybridSeException("SQL parse error: " + status.GetMsg() + "\n" + status.GetTraces());
        }
        status.delete();
        compileInfo = session.GetCompileInfo();
        plan = compileInfo.GetPhysicalPlan();
    }
/**
     * Initialize engine with given sql, database and specified engine options.
     *
     * @param sql query sql string
     * @param databases query on the databases
     * @param engineOptions query engine options
     * @param defaultDbName default database name
     * @throws UnsupportedHybridSeException throw when query unsupported or has syntax error
     */
Initialize engine with given sql, database and specified engine options.
Initialize engine with given sql database and specified engine options .
public void initilize(String sql, List<TypeOuterClass.Database> databases, EngineOptions engineOptions,
                          String defaultDbName)
            throws UnsupportedHybridSeException {
        options = engineOptions;
        catalog = new SimpleCatalog();
        session = new BatchRunSession();
        for (TypeOuterClass.Database database: databases) {
            catalog.AddDatabase(database);
        }
        engine = new Engine(catalog, options);
        BaseStatus status = new BaseStatus();
        boolean ok = engine.Get(sql, Objects.isNull(defaultDbName) ? "" : defaultDbName, session, status);
        if (!(ok && status.getMsg().equals("ok"))) {
            throw new UnsupportedHybridSeException("SQL parse error: " + status.GetMsg() + "\n" + status.GetTraces());
        }
        status.delete();
        compileInfo = session.GetCompileInfo();
        plan = compileInfo.GetPhysicalPlan();
    }
public void initilize ( String sql , List < TypeOuterClass . Database > databases , EngineOptions engineOptions , String defaultDbName ) throws UnsupportedHybridSeException { options = engineOptions ; catalog = new SimpleCatalog ( ) ; session = new BatchRunSession ( ) ; for ( TypeOuterClass . Database database : databases ) { catalog . AddDatabase ( database ) ; } engine = new Engine ( catalog , options ) ; BaseStatus status = new BaseStatus ( ) ; boolean ok = engine . Get ( sql , Objects . isNull ( defaultDbName ) ? "" : defaultDbName , session , status ) ; if ( ! ( ok && status . getMsg ( ) . equals ( "ok" ) ) ) { throw new UnsupportedHybridSeException ( "SQL parse error: " + status . GetMsg ( ) + "\n" + status . GetTraces ( ) ) ; } status . delete ( ) ; compileInfo = session . GetCompileInfo ( ) ; plan = compileInfo . GetPhysicalPlan ( ) ; }
Initialize engine with given sql, database and specified engine options.
Initialize engine with given sql database and specified engine options .