[ 
https://issues.apache.org/jira/browse/TAJO-1926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14958126#comment-14958126
 ] 

ASF GitHub Bot commented on TAJO-1926:
--------------------------------------

Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/824#discussion_r42074212
  
    --- Diff: 
tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestPartitionedTableRewriter.java
 ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.tajo.engine.planner;
    +
    +import org.apache.hadoop.fs.Path;
    +import org.apache.http.conn.scheme.Scheme;
    +import org.apache.tajo.OverridableConf;
    +import org.apache.tajo.QueryTestCaseBase;
    +import org.apache.tajo.algebra.LiteralValue;
    +import org.apache.tajo.catalog.CatalogUtil;
    +import org.apache.tajo.catalog.Column;
    +import org.apache.tajo.catalog.Schema;
    +import org.apache.tajo.catalog.TableDesc;
    +import org.apache.tajo.common.TajoDataTypes;
    +import org.apache.tajo.datum.DatumFactory;
    +import org.apache.tajo.plan.expr.*;
    +import org.apache.tajo.plan.rewrite.rules.PartitionedTableRewriter;
    +import org.apache.tajo.util.CommonTestingUtil;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Test;
    +
    +import java.sql.ResultSet;
    +
    +import static org.junit.Assert.assertEquals;
    +import static org.junit.Assert.assertNotNull;
    +
    +public class TestPartitionedTableRewriter extends QueryTestCaseBase {
    +  @Before
    +  public void setUp() throws Exception {
    +    executeString("create database " + getCurrentDatabase()).close();
    +  }
    +
    +  @After
    +  public void tearDown() throws Exception {
    +    executeString("drop database " + getCurrentDatabase()).close();
    +  }
    +
    +  @Test
    +  public final void testPartitionPruningUsingDirectories() throws 
Exception {
    +    String databaseName = getCurrentDatabase().toLowerCase();
    +    String tableName = 
"testPartitionPruningUsingDirectories".toLowerCase();
    +    String canonicalTableName = 
CatalogUtil.getCanonicalTableName(databaseName, tableName);
    +
    +    executeString(
    +      "create table " + canonicalTableName + "(col1 int4, col2 int4) 
partition by column(key float8) "
    +        + " as select l_orderkey, l_partkey, l_quantity from 
default.lineitem");
    +
    +    TableDesc tableDesc = catalog.getTableDesc(databaseName, tableName);
    +    assertNotNull(tableDesc);
    +
    +    PartitionedTableRewriter rewriter = new PartitionedTableRewriter();
    +    OverridableConf conf = CommonTestingUtil.getSessionVarsForTest();
    +
    +    Schema partitionColumns = 
tableDesc.getPartitionMethod().getExpressionSchema();
    +
    +    // Get all partitions
    +    Path[] filteredPaths = rewriter.findFilteredPaths(conf, 
partitionColumns, null, new Path(tableDesc.getUri()));
    --- End diff --
    
    You should test 
```PartitionedTableRewriter::findFilteredPartitionPaths()``` instead of 
```PartitionedTableRewriter::findFilteredPaths()```.


> Disable partition pruning using catalog temporarily.
> ----------------------------------------------------
>
>                 Key: TAJO-1926
>                 URL: https://issues.apache.org/jira/browse/TAJO-1926
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: Catalog, Physical Operator, Planner/Optimizer
>    Affects Versions: 0.11.0, 0.12.0
>            Reporter: Jaehwa Jung
>            Assignee: Jaehwa Jung
>            Priority: Critical
>             Fix For: 0.11.0
>
>
> We disabled alter table add partition temporarily at TAJO-1887. But when 
> adding partitions with dfs command for external partitioned table, there is 
> no way to add partition to catalog. As a result, users can't scan their 
> partitions which are added manually to file system. So, we need to disable 
> partition pruning using catalog until implement TAJO-1891.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to