weiting-chen opened a new issue, #5348:
URL: https://github.com/apache/incubator-gluten/issues/5348
### Backend
VL (Velox)
### Bug description
Reproduce Steps:
Step 1. Generate data.txt via below python script
`To generate file:gen_spill_data.py`
# -*- coding: utf-8 -*-
import random
# define a function to generate a random number from digital length 0 to 20
def random_number_string(length=20):
range_start = 10**(length-1)
range_end = (10**length) - 1
return str(random.randint(range_start, range_end))
# create a writable file if the file does not exist
with open('data.txt', 'w') as file:
# loop 10000 times
for _ in range(10000000):
# generate four random number with the length 0 to 20
f1 = random_number_string()
f2 = random_number_string()
f3 = random_number_string()
f4 = random_number_string()
# Write those four number into the file with comma as delimitation
file.write("{}\t{}\t{}\t{}\n".format(f1, f2, f3, f4))
`Use gen_spill_data.py to generate data.txt`
python gen_spill_data.py
Step 2. Create table and import the data
create table unisql.test_spill_02 (f1 string, f2 string, f3 string, f4
string) stored as textfile OPTIONS ('field.delim' = '\t');
hdfs dfs -put -f data.txt
hdfs://xxx/user/hive/warehouse/unisql.db/test_spill_02/
create table unisql.test_spill_03 stored as parquet as select * from
unisql.test_spill_02 distribute by f1;
Step 3. Launch Gluten and use below parameters to set up the environment:
--executor-memory 1024m
--conf "spark.memory.offHeap.size"="1024m"
--conf "spark.memory.offHeap.enabled"="true"
Step 4. Run SQL and check the log
create table unisql.test_spill_bad stored as parquet as
select f1, f2, f3, f4
,lag(f2) over(partition by f1 order by cast(f4 as bigint) asc) f5
from unisql.test_spill_03;
### Spark version
Spark-3.2.x
### Spark configurations
--executor-memory 1024m
--conf "spark.memory.offHeap.size"="1024m"
--conf "spark.memory.offHeap.enabled"="true"
### System information
_No response_
### Relevant logs
```bash
Caused by: java.lang.RuntimeException: Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Retriable: False
Expression: spillRun.rows.empty()
Function: checkEmptySpillRuns
File:
/app/dps-ssc-core-gluten/ep/build-velox/build/velox_ep/velox/exec/Spiller.cpp
Line: 494
Stack trace:
# 0 _ZN8facebook5velox7process10StackTraceC1Ei
# 1
_ZN8facebook5velox14VeloxExceptionC1EPKcmS3_St17basic_string_viewIcSt11char_traitsIcEES7_S7_S7_bNS1_4TypeES7_
# 2
_ZN8facebook5velox6detail14veloxCheckFailINS0_17VeloxRuntimeErrorENS1_22CompileTimeEmptyStringEEEvRKNS1_18VeloxCheckFailArgsET0_
# 3 _ZNK8facebook5velox4exec7Spiller19checkEmptySpillRunsEv
# 4
_ZN8facebook5velox4exec7Spiller13fillSpillRunsEPKNS1_20RowContainerIteratorE
# 5 _ZN8facebook5velox4exec7Spiller5spillEPKNS1_20RowContainerIteratorE
# 6 _ZN8facebook5velox4exec10SortBuffer5spillEv
# 7
_ZN8facebook5velox4exec10SortBuffer15ensureInputFitsERKSt10shared_ptrINS0_10BaseVectorEE
# 8
_ZN8facebook5velox4exec10SortBuffer8addInputERKSt10shared_ptrINS0_10BaseVectorEE
# 9 _ZN8facebook5velox4exec7OrderBy8addInputESt10shared_ptrINS0_9RowVectorEE
# 10
_ZN8facebook5velox4exec6Driver11runInternalERSt10shared_ptrIS2_ERS3_INS1_13BlockingStateEERS3_INS0_9RowVectorEE
# 11
_ZN8facebook5velox4exec6Driver4nextERSt10shared_ptrINS1_13BlockingStateEE
# 12 _ZN8facebook5velox4exec4Task4nextEPN5folly10SemiFutureINS3_4UnitEEE
# 13 _ZN6gluten24WholeStageResultIterator4nextEv
# 14 Java_io_glutenproject_vectorized_ColumnarBatchOutIterator_nativeHasNext
# 15 0x00007f097d017a14
at
io.glutenproject.vectorized.ColumnarBatchOutIterator.nativeHasNext(Native
Method) ~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at
io.glutenproject.vectorized.ColumnarBatchOutIterator.hasNextInternal(ColumnarBatchOutIterator.java:65)
~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at
io.glutenproject.vectorized.GeneralOutIterator.hasNext(GeneralOutIterator.java:37)
~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at
scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:45)
~[scala-library-2.12.15.jar:?]
at io.glutenproject.utils.IteratorCompleter.hasNext(Iterators.scala:69)
~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at io.glutenproject.utils.PayloadCloser.hasNext(Iterators.scala:35)
~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at
io.glutenproject.utils.PipelineTimeAccumulator.hasNext(Iterators.scala:98)
~[gluten-velox-bundle-spark3.2_2.12-centos_7-1.1.0.jar:?]
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
~[scala-library-2.12.15.jar:?]
at
org.apache.spark.writer.gluten.uniffle.writer.NativeShuffleWriter.writeImpl(NativeShuffleWriter.scala:91)
~[gluten-uniffle-1.0-SNAPSHOT.jar:?]
at
org.apache.spark.writer.gluten.uniffle.writer.NativeShuffleWriter.write(NativeShuffleWriter.scala:73)
~[gluten-uniffle-1.0-SNAPSHOT.jar:?]
at
org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at
org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:99)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at
org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:52)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at org.apache.spark.scheduler.Task.run(Task.scala:131)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at
org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:506)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1462)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:509)
~[spark-core_2.12-3.2.1_20230222.jar:3.2.1]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
~[?:1.8.0_275]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
~[?:1.8.0_275]
at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_275]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]