public ReaderPageSourceWithRowPositions createDataPageSource()

in amoro-format-mixed/amoro-mixed-trino/src/main/java/org/apache/amoro/trino/unkeyed/IcebergPageSourceProvider.java [403:477]


  public ReaderPageSourceWithRowPositions createDataPageSource(
      ConnectorSession session,
      TrinoFileSystem fileSystem,
      TrinoInputFile inputFile,
      long start,
      long length,
      long fileRecordCount,
      int partitionSpecId,
      String partitionData,
      IcebergFileFormat fileFormat,
      Schema fileSchema,
      List<IcebergColumnHandle> dataColumns,
      TupleDomain<IcebergColumnHandle> predicate,
      Optional<NameMapping> nameMapping,
      Map<Integer, Optional<String>> partitionKeys,
      DateTimeZone dateTimeZone) {
    switch (fileFormat) {
      case ORC:
        return createOrcPageSource(
            inputFile,
            start,
            length,
            fileRecordCount,
            partitionSpecId,
            partitionData,
            dataColumns,
            predicate,
            orcReaderOptions
                .withMaxMergeDistance(getOrcMaxMergeDistance(session))
                .withMaxBufferSize(getOrcMaxBufferSize(session))
                .withStreamBufferSize(getOrcStreamBufferSize(session))
                .withTinyStripeThreshold(getOrcTinyStripeThreshold(session))
                .withMaxReadBlockSize(getOrcMaxReadBlockSize(session))
                .withLazyReadSmallRanges(getOrcLazyReadSmallRanges(session))
                .withNestedLazy(isOrcNestedLazy(session))
                .withBloomFiltersEnabled(isOrcBloomFiltersEnabled(session)),
            fileFormatDataSourceStats,
            typeManager,
            nameMapping,
            partitionKeys);
      case PARQUET:
        return createParquetPageSource(
            inputFile,
            start,
            length,
            fileRecordCount,
            partitionSpecId,
            partitionData,
            dataColumns,
            parquetReaderOptions
                .withMaxReadBlockSize(getParquetMaxReadBlockSize(session))
                .withMaxReadBlockRowCount(getParquetMaxReadBlockRowCount(session))
                .withBatchColumnReaders(isParquetOptimizedReaderEnabled(session)),
            predicate,
            fileFormatDataSourceStats,
            nameMapping,
            partitionKeys,
            dateTimeZone);
      case AVRO:
        return createAvroPageSource(
            fileSystem,
            inputFile,
            start,
            length,
            fileRecordCount,
            partitionSpecId,
            partitionData,
            fileSchema,
            nameMapping,
            dataColumns);
      default:
        throw new TrinoException(
            NOT_SUPPORTED, "File format not supported for Iceberg: " + fileFormat);
    }
  }