mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Encapsulate CreateFunction (#1573)
This commit is contained in:
parent
bd750dfada
commit
e16b24679a
6 changed files with 149 additions and 148 deletions
|
@ -21,9 +21,10 @@
|
|||
//! is also tested (on the inputs it can handle).
|
||||
|
||||
use sqlparser::ast::{
|
||||
ClusteredBy, CommentDef, CreateFunctionBody, CreateFunctionUsing, CreateTable, Expr, Function,
|
||||
FunctionArgumentList, FunctionArguments, Ident, ObjectName, OneOrManyWithParens, OrderByExpr,
|
||||
SelectItem, Statement, TableFactor, UnaryOperator, Use, Value,
|
||||
ClusteredBy, CommentDef, CreateFunction, CreateFunctionBody, CreateFunctionUsing, CreateTable,
|
||||
Expr, Function, FunctionArgumentList, FunctionArguments, Ident, ObjectName,
|
||||
OneOrManyWithParens, OrderByExpr, SelectItem, Statement, TableFactor, UnaryOperator, Use,
|
||||
Value,
|
||||
};
|
||||
use sqlparser::dialect::{GenericDialect, HiveDialect, MsSqlDialect};
|
||||
use sqlparser::parser::ParserError;
|
||||
|
@ -392,13 +393,13 @@ fn set_statement_with_minus() {
|
|||
fn parse_create_function() {
|
||||
let sql = "CREATE TEMPORARY FUNCTION mydb.myfunc AS 'org.random.class.Name' USING JAR 'hdfs://somewhere.com:8020/very/far'";
|
||||
match hive().verified_stmt(sql) {
|
||||
Statement::CreateFunction {
|
||||
Statement::CreateFunction(CreateFunction {
|
||||
temporary,
|
||||
name,
|
||||
function_body,
|
||||
using,
|
||||
..
|
||||
} => {
|
||||
}) => {
|
||||
assert!(temporary);
|
||||
assert_eq!(name.to_string(), "mydb.myfunc");
|
||||
assert_eq!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue