Skip to content

Spark support only i32 indexed arrays while comet is trying to support both i32 and i64 #1114

@SemyonSinchenko

Description

@SemyonSinchenko

What is the problem the feature request solves?

At the moment Comet is trying to support both List and LargeList for handling array functions:

But in the spark the maximal size of any array is equal to java.lang.Integer.MAX_VALUES - 15 and any attempt to create an array of the bigger size will throw an exception:

  def cannotCreateArrayWithElementsExceedLimitError(
      numElements: Long, additionalErrorMessage: String): SparkRuntimeException = {
    new SparkRuntimeException(
      errorClass = "_LEGACY_ERROR_TEMP_2176",
      messageParameters = Map(
        "numElements" -> numElements.toString(),
        "maxRoundedArrayLength"-> ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH.toString(),
        "additionalErrorMessage" -> additionalErrorMessage))
  }

Describe the potential solution

Refactoring of all the code in list.rs and drop the support of arrow LargeList. It will simplify an existing code and also simplify resolving of the #1042

Additional context

I can try to make a refactoring and check if tests are passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions