Skip to content

[Bug]: s3option + format='parquet' rejected by InitS3Param (blocks hive_partitioning over S3) #24341

Closed

Description

@Ariznawlll

Branch

Tested on PR #24329 branch iamlinjunhong:dp-hive (commit ab6058a)

Actual Behavior

PR #24329 documents a usage pattern of combining URL s3option{...} with hive_partitioning='true' + format='parquet'. The DDL succeeds, but any SELECT fails:

ERROR 20300 (HY000): invalid configuration: the format 'parquet' is not supported

Reproduction

create external table t1 (
    id int, y int
) URL s3option {
    'endpoint' = 'localhost:9100',
    'access_key_id' = 'minioadmin',
    'secret_access_key' = 'minioadmin',
    'bucket' = 'any',
    'filepath' = 'any/',
    'provider' = 'minio',
    'format' = 'parquet'
};

-- DDL succeeds
select * from t1 limit 1;
-- ERROR 20300 (HY000): invalid configuration: the format 'parquet' is not supported

Root cause

InitFileParam (local infile path) accepts parquet:

// pkg/sql/plan/utils.go:1735
if format != tree.CSV && format != tree.JSONLINE && format != tree.PARQUET {
    return moerr.NewBadConfigf(param.Ctx, "the format '%s' is not supported", format)
}

But InitS3Param (s3option path) does not — tree.PARQUET is missing from the allowlist:

// pkg/sql/plan/utils.go:1796
if format != tree.CSV && format != tree.JSONLINE {
    return moerr.NewBadConfigf(param.Ctx, "the format '%s' is not supported", format)
}

Impact

The PR's user guide explicitly promotes URL s3option{...} as the primary production usage pattern (section "3. Point at S3"), but this code path is unusable. Only local infile{...} + parquet works today.

Since the whole point of hive_partitioning is lakehouse interop over S3, this blocks the feature's main use case.

Fix

Add tree.PARQUET to the allowed-format list in InitS3Param, mirroring InitFileParam.

Expected Behavior

URL s3option{... 'format'='parquet' ...} should behave identically to infile{... 'format'='parquet' ...} for both hive-partitioned and non-hive external tables.

Activity

  1. Ariznawlll commented on May 12, 2026

    @Ariznawlll
    CollaboratorAuthor

    Verification on latest main (commit b136990)

    Result: FIXED ✅

    PR #24321 (feat(external): support Hive-style partitioned Parquet external tables) merged to main on 2026-05-12 includes the fix for InitS3Param format validation.

    In pkg/sql/plan/utils.go line 1989, InitS3Param now accepts tree.PARQUET:

    case "format":
        format := strings.ToLower(param.Option[i+1])
        if format != tree.CSV && format != tree.JSONLINE && format != tree.PARQUET {
            return moerr.NewBadConfigf(param.Ctx, "the format '%s' is not supported", format)
        }
        param.Format = format

    Additionally, the hive partitioning options are now parsed via parseHiveOptionKV in the S3 path (line 1959), and validateHiveOptionConsistency is called after option parsing (line 2005), enabling full URL s3option{... 'format'='parquet', 'hive_partitioning'='true' ...} support.

    This means the primary production pattern (hive-partitioned external tables over S3) is now functional, matching the behavior of the infile{...} path.

    Note: unable to run full unit tests locally due to C dependency build issues, but code-level verification confirms the fix is complete.

  2. Ariznawlll commented on May 12, 2026

    @Ariznawlll
    CollaboratorAuthor

    Verification on 3.0-dev (commit 5fde73e)

    Result: FIXED on 3.0-dev

    InitS3Param on 3.0-dev correctly accepts tree.PARQUET in the format validation:

    if format != tree.CSV && format != tree.JSONLINE && format != tree.PARQUET {
        return moerr.NewBadConfigf(...)
    }

    This was included in PR #24329 which is already on 3.0-dev. The S3 + parquet + hive_partitioning path is functional.

  3. Ariznawlll commented on May 15, 2026

    @Ariznawlll
    CollaboratorAuthor

    Verified fixed on both branches — closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions