Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug请修正:alink+flink1.9连接mysql报错 #177

Open
JasonZhang1991 opened this issue Jul 16, 2021 · 1 comment
Open

bug请修正:alink+flink1.9连接mysql报错 #177

JasonZhang1991 opened this issue Jul 16, 2021 · 1 comment

Comments

@JasonZhang1991
Copy link

JasonZhang1991 commented Jul 16, 2021

`String[] columns=new String[]{"f0", "f1asd"};
AlinkGlobalConfiguration.setPluginDir("E:\flinkModel");

    List <Row> sourceFrame = Arrays.asList(
            Row.of(1.0, 0.0),
            Row.of(2.0, 1.0),
            Row.of(3.0, 2.0)
    );
    EnvironmentSettings settings = EnvironmentSettings
            .newInstance()
            .inStreamingMode()
            .build();

    TableEnvironment tableEnv = TableEnvironment.create(settings);
    String name            = "mypg";
    String defaultDatabase = "";
    String username        = "";
    String password        = "";
    String baseUrl         = "";
    String mysqlVersion="5.7.30";
    String port="10010";
    MySqlCatalog catalog = new MySqlCatalog(name, defaultDatabase,mysqlVersion, baseUrl,port,username, password);
    tableEnv.registerCatalog("mypg", catalog);
    tableEnv.useCatalog("mypg");
    Table table = tableEnv.sqlQuery("SELECTIFNULL(`dbModuleCopyStockStat`, 0) AS dbModuleCopyStockStat,IFNULL(`dbAppLinkStat`, 0) AS dbAppLinkStat,IFNULL(\t`dbTimeOutStat_utrans_timeout`,\t0) AS dbTimeOutStat_utrans_timeout,IFNULL(`lockWait`, 0) AS lockWait,IFNULL(\t`dbTimeOutStat_fetch_timeout`,\t0) AS dbTimeOutStat_fetch_timeout,IFNULL(\t`dbCrudStat_execute_success_count___update`,\t0) AS dbCrudStat_execute_success_count___update,IFNULL(\t`dbTimeOutStat_idle_timeout`,\t0)AS dbTimeOutStat_idle_timeout,IFNULL(\t`dbConnectTypeStat_NEW_JDBC`,\t0) AS dbConnectTypeStat_NEW_JDBC,IFNULL(\t`dbConnectTypeStat_CLI-64LE`,\t0) AS dbConnectTypeStat_CLI-64LE,IFNULL(\t`dbCrudStat_execute_success_count___select`,\t0)AS dbCrudStat_execute_success_count___select,IFNULL(`dbMemory_USAGE(%)`, 0) AS dbMemory_USAGE,IFNULL(\t`dbTimeOutStat_ddl_timeout`,\t0) AS dbTimeOutStat_ddl_timeout,IFNULL(`lockWaitCnt`, 0) AS lockWaitCnt,IFNULL(\t`transaction_active_count`,\t0) AS transaction_active_count,IFNULL(`dbServiceStat_POLL`, 0) AS dbServiceStat_POLL,IFNULL(\t`dbTimeOutStat_query_timeout`,\t0) AS dbTimeOutStat_query_timeout,IFNULL(\t`dbCrudStat_execute_success_count___delete`,\t0) AS dbCrudStat_execute_success_count___delete,IFNULL(`copyStock`, 0) AS copyStock,IFNULL(\t`dbCrudStat_execute_success_count___insert`,\t0) AS dbCrudStat_execute_success_count___insert,IFNULL(`dbLink`, 0) AS dbLink,IFNULL(`dataSynGemini`, 0) AS dataSynGemini,IFNULL(`longSql`, 0) AS longSql,IFNULL(`dbServiceStat_EXECUTE`, 0) AS dbServiceStat_EXECUTE FROMprometheus_qcube_data_2i WHEREip = '10.161.73.1' ORDER BYdata_time ASC");
    BatchOperator <?> batchSource = new MemSourceBatchOp(sourceFrame,columns);
    BatchOperator <?> tableBatchSource = new TableSourceBatchOp(table);

    StreamOperator <?> streamSource = new MemSourceStreamOp(sourceFrame, columns);
    BatchOperator <?> trainOp =
            new IsolationForestsTrainBatchOp().setFeatureCols("dbModuleCopyStockStat", "dbAppLinkStat","dbTimeOutStat_utrans_timeout","lockWait","dbTimeOutStat_fetch_timeout","dbCrudStat_execute_success_count___update"
            ,"dbTimeOutStat_idle_timeout","dbConnectTypeStat_NEW_JDBC","dbConnectTypeStat_CLI-64LE","dbCrudStat_execute_success_count___select","dbMemory_USAGE","dbTimeOutStat_ddl_timeout","lockWaitCnt",
                    "transaction_active_count","dbServiceStat_POLL","dbTimeOutStat_query_timeout","dbCrudStat_execute_success_count___delete","copyStock","dbCrudStat_execute_success_count___insert",
                    "dbLink","dataSynGemini","longSql","dbServiceStat_EXECUTE").linkFrom(tableBatchSource);
    AkSinkBatchOp csvSink1 = new AkSinkBatchOp();
    csvSink1.setFilePath("E:\\flinkModel\\test");
    trainOp.link(csvSink1);
    BatchOperator <?> predictBatchOp = new IsolationForestsPredictBatchOp().setPredictionCol("pred");
    predictBatchOp.linkFrom(trainOp, tableBatchSource).print();`

报错:
image
怀疑是bug

@JasonZhang1991
Copy link
Author

image
这个类在flink1.9中根本不存在

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant