TAJO-1493: Make partition pruning based on catalog informations.#624
TAJO-1493: Make partition pruning based on catalog informations.#624blrunner wants to merge 89 commits intoapache:masterfrom
Conversation
…into TAJO-1493
…into TAJO-1493
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java tajo-catalog/tajo-catalog-client/src/main/proto/CatalogProtocol.proto tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogService.java tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/CatalogServer.java tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-client/src/main/proto/CatalogProtocol.proto tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/CatalogServer.java
|
I implemented CatalogStore::getPartitionsByDirectSql which execute a select statement to CatalogStore for searching right partition directories. But current tajo testing cluster use MemStore for default CatalogStore and I couldn't execute the select statement because MemStore just retain all catalog informations to HashMap. If you want to verify this patch, you can test as following: |
|
I found that this patch run as expected with HiveCatalogStore and MySQLStore on my testing cluster. And simple query response had been reported as following:
Honestly, I didn't implement unit test cases for executing queries because current almost tajo unit cases operate on MemStore. If we apply DerbyStore to some unit test cases for physical operator, we would make a lot of effort. It seems not to be the scope of this patch. So, I just added unit test cases for verifying direct sql. But if you want to test this patch with build commands, you can test with |
…into TAJO-1493
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogService.java tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java
There was a problem hiding this comment.
You may forget the removal of commented out lines.
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/CatalogServer.java
There was a problem hiding this comment.
Catalog API is public. In terms of this point, this API design does not make sense due to the following problems:
- Users should know table schemas, their relationship, which underlying persistent storage.
- Users should make SQL statements for all persistent storages.
- This approach is very prone to SQL injection.
The solution is that you can use some intermediate representation, using string or java objects. They should be transformed into SQL statements depending on persistent storages in each catalog driver.
…into TAJO-1493 Conflicts: tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogService.java tajo-catalog/tajo-catalog-drivers/tajo-hive/src/main/java/org/apache/tajo/catalog/store/HiveCatalogStore.java tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/CatalogStore.java tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MemStore.java tajo-common/src/main/java/org/apache/tajo/exception/ErrorMessages.java
…into TAJO-1493
|
Hi @hyunsik I've implemented partition API using algebra expressions. For this feature, I implemented some visitors as following:
|
…into TAJO-1493
|
Thank you for your detailed review and I've just reflected your comments. |
There was a problem hiding this comment.
If it is not used, you may do not need to add this method.
|
Thanks @hyunsik I reflected your comments and left some comments. :) |
…into TAJO-1493
…into TAJO-1493
There was a problem hiding this comment.
Could you rename TimeStamp to Timestamp?
|
Thank you for your work. The latest patch looks good to me. Here is my +1. I leaved one comment. You can commit it after reflecting my comment if you agree. |
|
Thank you very much for your kind review. I've just reflected your comment. After finishing the travis CI build, I'll ship it. :) |
Not yet implemented unit test cases.