You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TestvoidtestRunQuery() {
varflinkSql = FlinkSql.builder()
.tableEnv(tableEnv)
.build()
.init();
varllm = ChatOpenAI.builder()
.temperature(0)
.build().init();
vartoolkit = newFlinkSqlToolkit(flinkSql, llm);
varagentExecutor = createFlinkSqlAgent(llm, toolkit);
// SELECT SQRT(AVG(Age)) FROM titanicvaractual = agentExecutor.run("whats the square root of the average age?");
// sometimes it's 'The square root of the average age is approximately 5.07.'assertEquals("5.07", actual);
// TODO: It should be DESC here, not ASC.// SELECT Name FROM titanic WHERE Survived = 1 ORDER BY Age ASC LIMIT 1actual = agentExecutor.run("What's the name of the oldest survived passenger?");
assertEquals("Sandstrom, Miss. Marguerite Rut", actual);
}
Similar to Spark SQL Agent,
visit https://python.langchain.com/docs/modules/agents/toolkits/spark_sql for more details.
The text was updated successfully, but these errors were encountered: