Chetan Bhat created SPARK-32700:
-----------------------------------

             Summary: select from table TABLESAMPLE gives wrong resultset.
                 Key: SPARK-32700
                 URL: https://issues.apache.org/jira/browse/SPARK-32700
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
         Environment: Spark 3.0.0
            Reporter: Chetan Bhat


create table test(id int,name string) stored as parquet;
insert into test values 
(5,'Alex'),(8,'Lucy'),(2,'Mary'),(4,'Fred'),(1,'Lisa'),(9,'Eric'),(10,'Adam'),(6,'Mark'),(7,'Lily'),(3,'Evan');
SELECT * FROM test TABLESAMPLE (50 PERCENT); --> output is giving only 3 rows.
spark-sql> SELECT * FROM test TABLESAMPLE (50 PERCENT);
5 Alex
10 Adam
4 Fred

 

Expected as per the link is 5 rows 
-->[https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-sampling.html]

 

Also the bucket parameter for select from table TABLESAMPLE gives wrong 
resultset.
spark-sql> SELECT * FROM test TABLESAMPLE (BUCKET 4 OUT OF 10);
5 Alex
8 Lucy
9 Eric
1 Lisa
3 Evan

Expected is 4 records.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to