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

Creating empty scramble should throw exception #351

Open commercial-hippie opened 5 years ago

commercial-hippie commented 5 years ago

When a scramble is created on a empty data set I think it should throw an error to avoid broken scrambles. (I tried to append to the scramble later).

Here is a example I got from a scramble on a empty table:

{"schemaName":"verdict_scrambles","tableName":"my_table","originalSchemaName":"default","originalTableName":"my_table","aggregationBlockColumn":"verdictdbblock","aggregationBlockCount":1,"tierColumn":"verdictdbtier","numberOfTiers":1,"method":"UNIFORM","scramblingMethod":{"blockSize":1000000,"type":"uniform","maxBlockCount":100,"relativeSize":0.1,"storedProbDist":{"0":["Infinity"]},"MAIN_TABLE_SOURCE_ALIAS":"t","totalNumberOfblocks":0,"actualNumberOfBlocks":1,"mainTableAlias":"t","tierCount":1,"blockCount":0,"actualBlockCount":1},"hashColumn":null,"cumulativeDistributions":{"0":["Infinity"]}}
"cumulativeDistributions":{"0":["Infinity"]}
"storedProbDist":{"0":["Infinity"]}
pyongjoo commented 5 years ago

I'm sorry that no one has been following up with this issue.

@dongyoungy Can you take a look into this? The fix seems to be pretty straightforward.

dongyoungy commented 5 years ago

I have already asked Jiacheng to look at an efficient way of determining an empty table to solve this issue.

pyongjoo commented 5 years ago

I see. That's great.

commercial-hippie commented 5 years ago

No worries, thank you!

Beastjoe commented 5 years ago

Hi, I have created a pull request to solve this problem. In the process of creating scramble, it will throw a VerdictDBException when empty table is detected.

dongyoungy commented 5 years ago

@commercial-hippie FYI, the fix for this issue has been merged into master.