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

Zoltan Haindrich commented on HIVE-15956:
-----------------------------------------

[~niklaus.xiao] to be on the same page...I think it would be good if I share 
what I've used during testing:
I used this script to generate a qfile
{code}
O=ql/src/test/queries/clientpositive/dp.q
cat > $O << EOF
create table test_partition(id int) partitioned by (dt int);
EOF

for i in `seq 1 10000`;do

echo "alter table test_partition add partition(dt=$i);"
done >> $O

cat >> $O << EOF
alter table test_partition drop partition(dt<9000);
EOF

{code}

and executed with:
{code}
time mvn install -Dtest=TestCliDriver  -DskipSparkTests   -Pitests  -q 
-Dtest.output.overwrite -Dqfile=dp.q -DinitScript=asd -T4 
{code}

I think the patch does work; I've checked it via a unit test written against 
metastore...but I'm not sure why this qtest doesn't confirm it...


> StackOverflowError when drop lots of partitions
> -----------------------------------------------
>
>                 Key: HIVE-15956
>                 URL: https://issues.apache.org/jira/browse/HIVE-15956
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 1.3.0, 2.2.0
>            Reporter: Niklaus Xiao
>            Assignee: Niklaus Xiao
>         Attachments: HIVE-15956.patch
>
>
> Repro steps:
> 1. Create partitioned table and add 10000 partitions
> {code}
> create table test_partition(id int) partitioned by (dt int);
> alter table test_partition add partition(dt=1);
> alter table test_partition add partition(dt=3);
> alter table test_partition add partition(dt=4);
> ...
> alter table test_partition add partition(dt=10000);
> {code}
> 2. Drop 9000 partitions:
> {code}
> alter table test_partition drop partition(dt<9000);
> {code}
> Step 2 will fail with StackOverflowError:
> {code}
> Exception in thread "pool-7-thread-161" java.lang.StackOverflowError
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.isOperator(ExpressionCompiler.java:819)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileOrAndExpression(ExpressionCompiler.java:190)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileExpression(ExpressionCompiler.java:179)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileOrAndExpression(ExpressionCompiler.java:192)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileExpression(ExpressionCompiler.java:179)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileOrAndExpression(ExpressionCompiler.java:192)
>     at 
> org.datanucleus.query.expression.ExpressionCompiler.compileExpression(ExpressionCompiler.java:179)
> {code}
> {code}
> Exception in thread "pool-7-thread-198" java.lang.StackOverflowError
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:83)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
>     at 
> org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:87)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to