Skip to content

Commit 4db95ee

Browse files
authored
chore: disable table info refreshing for ai_to_sql (#16240)
* chore: disable table info refreshing for ai_to_sql * add stateless test * chore: commetted out AI stateless test AI funcs are not testable in CI yet
1 parent 41956d0 commit 4db95ee

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/query/service/src/table_functions/openai/ai_to_sql.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,14 @@ impl AsyncSource for GPT2SQLSource {
185185
// SELECT
186186
let database = self.ctx.get_current_database();
187187
let tenant = self.ctx.get_tenant();
188-
let catalog = self.ctx.get_catalog(CATALOG_DEFAULT).await?;
188+
189+
// Disable table info refreshing.
190+
// Attached tables may not be able to refresh table info successfully.
191+
let catalog = self
192+
.ctx
193+
.get_catalog(CATALOG_DEFAULT)
194+
.await?
195+
.disable_table_info_refresh()?;
189196

190197
let mut template = vec![];
191198
template.push("### Postgres SQL tables, with their properties:".to_string());

tests/suites/5_ee/04_attach_read_only/02_0006_attach_table_ro_issue_16121.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ echo "set data_retention_time_in_days=0;vacuum drop table from issue_16121;" | $
1717

1818
echo "expects no error(nothing outputs)"
1919
echo "drop table issue_16121.attach_read_only" | $BENDSQL_CLIENT_CONNECT
20+
21+
# AI configurations (provider url, ak/sk) are not ready for CI, thus the following test case is commented out
22+
#echo "expects ai_to_sql works"
23+
#echo "SELECT* FROM ai_to_sql ('current time') IGNORE_RESULT" | $BENDSQL_CLIENT_CONNECT

0 commit comments

Comments
 (0)