support create function definition with $$ (#755)

* support create function definition using '2700775'

* fix warn
This commit is contained in:
zidaye 2022-12-14 06:15:33 +08:00 committed by GitHub
parent d420001c37
commit 6c545195e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 10 deletions

View file

@ -16,8 +16,8 @@
//! is also tested (on the inputs it can handle).
use sqlparser::ast::{
CreateFunctionBody, CreateFunctionUsing, Expr, Function, Ident, ObjectName, SelectItem,
Statement, TableFactor, UnaryOperator, Value,
CreateFunctionBody, CreateFunctionUsing, Expr, Function, FunctionDefinition, Ident, ObjectName,
SelectItem, Statement, TableFactor, UnaryOperator, Value,
};
use sqlparser::dialect::{GenericDialect, HiveDialect};
use sqlparser::parser::ParserError;
@ -252,7 +252,9 @@ fn parse_create_function() {
assert_eq!(
params,
CreateFunctionBody {
as_: Some("org.random.class.Name".to_string()),
as_: Some(FunctionDefinition::SingleQuotedDef(
"org.random.class.Name".to_string()
)),
using: Some(CreateFunctionUsing::Jar(
"hdfs://somewhere.com:8020/very/far".to_string()
)),