File tree 3 files changed +6
-24
lines changed
3 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,4 @@ impl Dialect for HiveDialect {
66
66
fn supports_table_sample_before_alias ( & self ) -> bool {
67
67
true
68
68
}
69
-
70
- /// See Hive <https://cwiki.apache.org/confluence/display/hive/languagemanual+sampling>
71
- fn supports_implicit_table_sample_method ( & self ) -> bool {
72
- true
73
- }
74
69
}
Original file line number Diff line number Diff line change @@ -718,16 +718,6 @@ pub trait Dialect: Debug + Any {
718
718
fn supports_table_sample_before_alias ( & self ) -> bool {
719
719
false
720
720
}
721
-
722
- /// Returns true if this dialect support not specifying a table sample method. For example:
723
- ///
724
- /// Implicit table sample method: `SELECT * FROM tbl TABLESAMPLE (10)`
725
- /// Explicit table sample method: `SELECT * FROM tbl TABLESAMPLE BERNOULLI (10)`
726
- ///
727
- /// <https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#sample-clause>
728
- fn supports_implicit_table_sample_method ( & self ) -> bool {
729
- false
730
- }
731
721
}
732
722
733
723
/// This represents the operators for which precedence must be defined
Original file line number Diff line number Diff line change @@ -12341,16 +12341,13 @@ fn parse_create_table_with_enum_types() {
12341
12341
12342
12342
#[ test]
12343
12343
fn test_table_sample ( ) {
12344
- let dialects = all_dialects_where ( |d| !d. supports_implicit_table_sample_method ( ) ) ;
12345
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE BERNOULLI (50)" ) ;
12346
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50)" ) ;
12347
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10)" ) ;
12348
-
12349
- // The only dialect that supports implicit tablesample is Hive and it requires aliase after the table sample
12350
- let dialects = all_dialects_where ( |d| {
12351
- d. supports_implicit_table_sample_method ( ) && d. supports_table_sample_before_alias ( )
12352
- } ) ;
12344
+ let dialects = all_dialects_where ( |d| d. supports_table_sample_before_alias ( ) ) ;
12353
12345
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50) AS t" ) ;
12354
12346
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50 ROWS) AS t" ) ;
12355
12347
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50 PERCENT) AS t" ) ;
12348
+
12349
+ let dialects = all_dialects_where ( |d| !d. supports_table_sample_before_alias ( ) ) ;
12350
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE BERNOULLI (50)" ) ;
12351
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50)" ) ;
12352
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10)" ) ;
12356
12353
}
You can’t perform that action at this time.
0 commit comments