File tree Expand file tree Collapse file tree 3 files changed +0
-70
lines changed
Expand file tree Collapse file tree 3 files changed +0
-70
lines changed Original file line number Diff line number Diff line change @@ -383,26 +383,6 @@ impl CreateTableBuilder {
383383 self
384384 }
385385
386- /// Returns true if the statement has exactly one source of info on the schema of the new table.
387- /// This is Snowflake-specific, some dialects allow more than one source.
388- pub ( crate ) fn validate_schema_info ( & self ) -> bool {
389- let mut sources = 0 ;
390- if !self . columns . is_empty ( ) {
391- sources += 1 ;
392- }
393- if self . query . is_some ( ) {
394- sources += 1 ;
395- }
396- if self . like . is_some ( ) {
397- sources += 1 ;
398- }
399- if self . clone . is_some ( ) {
400- sources += 1 ;
401- }
402-
403- sources == 1
404- }
405-
406386 pub fn build ( self ) -> Statement {
407387 Statement :: CreateTable ( CreateTable {
408388 or_replace : self . or_replace ,
Original file line number Diff line number Diff line change @@ -690,21 +690,9 @@ pub fn parse_create_table(
690690 builder = builder. columns ( columns) . constraints ( constraints) ;
691691 }
692692 Token :: EOF => {
693- if !builder. validate_schema_info ( ) {
694- return Err ( ParserError :: ParserError (
695- "unexpected end of input" . to_string ( ) ,
696- ) ) ;
697- }
698-
699693 break ;
700694 }
701695 Token :: SemiColon => {
702- if !builder. validate_schema_info ( ) {
703- return Err ( ParserError :: ParserError (
704- "unexpected end of input" . to_string ( ) ,
705- ) ) ;
706- }
707-
708696 parser. prev_token ( ) ;
709697 break ;
710698 }
Original file line number Diff line number Diff line change @@ -555,23 +555,6 @@ fn test_snowflake_create_table_comment() {
555555 }
556556}
557557
558- #[ test]
559- fn test_snowflake_create_table_incomplete_statement ( ) {
560- assert_eq ! (
561- snowflake( ) . parse_sql_statements( "CREATE TABLE my_table" ) ,
562- Err ( ParserError :: ParserError (
563- "unexpected end of input" . to_string( )
564- ) )
565- ) ;
566-
567- assert_eq ! (
568- snowflake( ) . parse_sql_statements( "CREATE TABLE my_table; (c int)" ) ,
569- Err ( ParserError :: ParserError (
570- "unexpected end of input" . to_string( )
571- ) )
572- ) ;
573- }
574-
575558#[ test]
576559fn test_snowflake_single_line_tokenize ( ) {
577560 let sql = "CREATE TABLE# this is a comment \n table_1" ;
@@ -1046,27 +1029,6 @@ fn test_snowflake_create_table_trailing_options() {
10461029 . unwrap ( ) ;
10471030}
10481031
1049- #[ test]
1050- fn test_snowflake_create_table_valid_schema_info ( ) {
1051- // Validate there's exactly one source of information on the schema of the new table
1052- assert_eq ! (
1053- snowflake( )
1054- . parse_sql_statements( "CREATE TABLE dst" )
1055- . is_err( ) ,
1056- true
1057- ) ;
1058- assert_eq ! (
1059- snowflake( ) . parse_sql_statements( "CREATE OR REPLACE TEMP TABLE dst LIKE src AS (SELECT * FROM CUSTOMERS) ON COMMIT PRESERVE ROWS" ) . is_err( ) ,
1060- true
1061- ) ;
1062- assert_eq ! (
1063- snowflake( )
1064- . parse_sql_statements( "CREATE OR REPLACE TEMP TABLE dst CLONE customers LIKE customer2" )
1065- . is_err( ) ,
1066- true
1067- ) ;
1068- }
1069-
10701032#[ test]
10711033fn parse_sf_create_or_replace_view_with_comment_missing_equal ( ) {
10721034 assert ! ( snowflake_and_generic( )
You can’t perform that action at this time.
0 commit comments