doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] Spark load failed when partition column is not a key in duplicate model

Open xiaoDjun opened this issue 4 years ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

1.1.3-rc02

What's Wrong?

In spark load, importing to a duplicate model, the job failed when the partition column is not in the key column list.

We traced the sparkDpp.java and found that, the partition columns ware built with the key index in base metadata. But when partition column was out of key column list, an IndexOutOfBoundsException occurs when obtaining it through below:

image

image

Later I will post the exception log.

What You Expected?

Able to import using spark load in this case.

How to Reproduce?

  1. create a duplicate model, and partition column is not key Index.
  2. submit a spark load etl job.

Anything Else?

No response

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

xiaoDjun avatar Nov 25 '22 12:11 xiaoDjun

The exception:

java.lang.IndexOutOfBoundsException: Index: 3, Size: 1 
at java.util.ArrayList.rangeCheck(ArrayList.java:657) 
at java.util.ArrayList.get(ArrayList.java:433) 
at org.apache.doris.load.loadv2.dpp.DppColumns.<init>(DppColumns.java:39) 
at org.apache.doris.load.loadv2.dpp.DorisRangePartitioner.getPartition(DorisRangePartitioner.java:56) 
at org.apache.doris.load.loadv2.dpp.SparkDpp$2.call(SparkDpp.java:487) 
at org.apache.doris.load.loadv2.dpp.SparkDpp$2.call(SparkDpp.java:460) 
at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$3$1.apply(JavaRDDLike.scala:143) 
at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$3$1.apply(JavaRDDLike.scala:143) 
at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434) 
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440) 
at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:125) 
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96) 
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53) 
at org.apache.spark.scheduler.Task.run(Task.scala:109) 
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
at java.lang.Thread.run(Thread.java:748) 
Driver stacktrace:

xiaoDjun avatar Nov 29 '22 02:11 xiaoDjun