verdict-project / verdict

Interactive-Speed Analytics: 200x Faster, 200x Fewer Cluster Resources, Approximate Query Processing
http://verdictdb.org
Apache License 2.0
248 stars 66 forks source link

throw exception when creating scramble on empty table #353

Closed Beastjoe closed 5 years ago

Beastjoe commented 5 years ago

Related Issue #351 VerdictDB will throw exception if empty table is used to create scramble. I do this by checking totalBlockSize in ScrambleNode.createQuery(). If totalBlockSize==0, it is equivalent to say the table size is 0.

codecov-io commented 5 years ago

Codecov Report

Merging #353 into master will increase coverage by 0.15%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #353      +/-   ##
==========================================
+ Coverage   71.02%   71.16%   +0.15%     
==========================================
  Files         168      168              
  Lines       11492    11487       -5     
  Branches     1874     1874              
==========================================
+ Hits         8161     8174      +13     
+ Misses       2849     2841       -8     
+ Partials      482      472      -10
Impacted Files Coverage Δ
.../org/verdictdb/core/scrambling/ScramblingNode.java 94.32% <100%> (+0.14%) :arrow_up:
...rg/verdictdb/exception/VerdictDBDbmsException.java 50% <0%> (-50%) :arrow_down:
...ava/org/verdictdb/connection/SparkQueryResult.java 55.36% <0%> (-3.96%) :arrow_down:
.../core/scrambling/FastConvergeScramblingMethod.java 89.02% <0%> (-3.46%) :arrow_down:
.../verdictdb/core/execplan/ExecutableNodeRunner.java 83.7% <0%> (-3.43%) :arrow_down:
...main/java/org/verdictdb/sqlsyntax/MysqlSyntax.java 85.3% <0%> (-2.94%) :arrow_down:
...core/querying/ola/SelectAsyncAggExecutionNode.java 93.25% <0%> (-2.7%) :arrow_down:
...java/org/verdictdb/connection/JdbcQueryResult.java 96.25% <0%> (-0.13%) :arrow_down:
.../java/org/verdictdb/commons/DataTypeConverter.java 98.88% <0%> (-0.01%) :arrow_down:
...c/main/java/org/verdictdb/VerdictSingleResult.java 77.78% <0%> (ø) :arrow_up:
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e66a96a...4a65810. Read the comment docs.

dongyoungy commented 5 years ago

I first thought we had to use different method for determining an empty table as opposed checking the size of the table, but I guess if it is an empty table, SELECT COUNT(*) will run quickly anyway so it seems fine to do it this way.