feat: upgraded pg_catalog support (#6918)

* refactor: add datafusion-postgres dependency

* refactor: move and include pg_catalog udfs

* chore: update upstream

* feat: register table function pg_get_keywords

* feat: bridge CatalogInfo for our CatalogManager

Signed-off-by: Ning Sun <sunning@greptime.com>

* feat: convert pg_catalog table to our system table

* feat: bridge system catalog with datafusion-postgres

Signed-off-by: Ning Sun <sunning@greptime.com>

* feat: add more udfs

* feat: add compatibility rewriter to postgres handler

* fix: various fix

* fmt: fix

* fix: use functions from pg_catalog library

* fmt

* fix: sqlness runner

Signed-off-by: Ning Sun <sunning@greptime.com>

* test: adopt arrow 56.0 to 56.1 memory size change

* fix: add additional udfs

* chore: format

* refactor: return None when creating system table failed

Signed-off-by: Ning Sun <sunning@greptime.com>

* chore: provide safety comments about expect usage

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
Ning Sun
2025-09-25 12:05:34 +08:00
committed by GitHub
parent 91a727790d
commit 964dc254aa
31 changed files with 1294 additions and 1412 deletions

View File

@@ -68,7 +68,9 @@ impl ParserContext<'_> {
.parser
.parse_literal_uint()
.context(error::SyntaxSnafu)?;
let _ = self.parser.parse_keyword(Keyword::FROM);
let _ = self
.parser
.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]);
let cursor_name = self
.parser

View File

@@ -130,7 +130,14 @@ impl ParserContext<'_> {
} else if self.consume_token("PROCESSLIST") {
self.parse_show_processlist(false)
} else {
self.unsupported(self.peek_token_as_string())
// follow postgres dialect and assume the next token is the variable
let variable = self
.parse_object_name()
.with_context(|_| error::UnexpectedSnafu {
expected: "a variable name",
actual: self.peek_token_as_string(),
})?;
Ok(Statement::ShowVariables(ShowVariables { variable }))
}
}