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 @@ -12386,16 +12386,13 @@ fn parse_create_table_with_enum_types() {
12386
12386
12387
12387
#[ test]
12388
12388
fn test_table_sample ( ) {
12389
- let dialects = all_dialects_where ( |d| !d. supports_implicit_table_sample_method ( ) ) ;
12390
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE BERNOULLI (50)" ) ;
12391
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50)" ) ;
12392
- dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10)" ) ;
12393
-
12394
- // The only dialect that supports implicit tablesample is Hive and it requires aliase after the table sample
12395
- let dialects = all_dialects_where ( |d| {
12396
- d. supports_implicit_table_sample_method ( ) && d. supports_table_sample_before_alias ( )
12397
- } ) ;
12389
+ let dialects = all_dialects_where ( |d| d. supports_table_sample_before_alias ( ) ) ;
12398
12390
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50) AS t" ) ;
12399
12391
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50 ROWS) AS t" ) ;
12400
12392
dialects. verified_stmt ( "SELECT * FROM tbl TABLESAMPLE (50 PERCENT) AS t" ) ;
12393
+
12394
+ let dialects = all_dialects_where ( |d| !d. supports_table_sample_before_alias ( ) ) ;
12395
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE BERNOULLI (50)" ) ;
12396
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50)" ) ;
12397
+ dialects. verified_stmt ( "SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10)" ) ;
12401
12398
}
You can’t perform that action at this time.
0 commit comments