<@U0A71G31CDV> Can we run alter table with new pat...
# questions-and-troubleshooting
a
@Rocky Can we run alter table with new path for external tables? Eg.
Copy code
CREATE EXTERNAL TABLE IF NOT EXISTS external_table_name (

) 
ENGINE = file
PROPERTIES (
    "path" = "{GCS_PATH}",
    "format" = "parquet"
);
r
Hello! I'm Rocky. For external tables using
ENGINE = file
, StarRocks does not currently support modifying the
"path"
property (or most other properties) via an
ALTER TABLE
statement. Since it is an external table, the data resides in your cloud storage (GCS) and StarRocks only stores the metadata (the schema and the pointer to the path). Dropping the table in StarRocks will not delete your actual data files in GCS. Recommended Approach To "update" the path, you should drop the existing table and recreate it with the new path: 1. Drop the table metadata:
Copy code
sql
   DROP TABLE IF EXISTS external_table_name;
2. Recreate the table with the new path:
Copy code
sql
   CREATE EXTERNAL TABLE external_table_name (
       -- column definitions
   )
   ENGINE = file
   PROPERTIES (
       "path" = "<gs://new_gcs_path/data/>",
       "format" = "parquet"
   );
A Few Tips: * Wildcards: If you want to include multiple files or subdirectories, you can often use wildcards in the path (e.g.,
"path" = "<gs://bucket/folder/*>"
). * External Catalogs: If you are managing a large number of tables or the paths change frequently, consider using External Catalogs (like Hive or Iceberg catalogs) which automatically synchronize table metadata, or use the newer
FILES()
table function for ad-hoc queries without creating a table at all. Let me know if you have any other questions!
a
@Rocky what about List[Paths] in definition instead of wildcards?
r
Hi there! I'm Rocky. While I'm having a little trouble reaching my documentation index right now, I can certainly help answer this based on StarRocks' standard behavior for loading data and external tables. In StarRocks, if you want to specify a specific set of files instead of using wildcards (like
*
), the approach depends on which method you are using: 1. Using the
FILES()
Table Function (Recommended)
When using the
FILES()
table function (often used for
INSERT INTO ... SELECT
or ad-hoc queries from S3, GCS, or Azure Storage), you can provide a comma-separated list of paths within the
path
parameter.
Copy code
sql
SELECT * FROM FILES(
    "path" = "<s3://my-bucket/data/file1.parquet>, <s3://my-bucket/data/file2.parquet>",
    "format" = "parquet"
);
Note: Ensure there are no spaces between the comma and the next path unless they are part of the file name. 2. Using Broker Load If you are using a Broker Load (the standard asynchronous load method), you have two options for specifying multiple specific files: * Multiple paths in one `DATA INFILE`:
Copy code
sql
    LOAD LABEL my_db.label_1
    (
        DATA INFILE("<s3://bucket/file1.csv>", "<s3://bucket/file2.csv>")
        INTO TABLE my_table
    )
    WITH BROKER my_broker (...);
* Multiple
DATA INFILE
clauses:
Copy code
sql
    LOAD LABEL my_db.label_2
    (
        DATA INFILE("<s3://bucket/file1.csv>") INTO TABLE my_table,
        DATA INFILE("<s3://bucket/file2.csv>") INTO TABLE my_table
    )
    WITH BROKER my_broker (...);
3. External Tables For most External Tables (like those pointing to HDFS or S3), the definition usually points to a directory rather than a list of specific files. StarRocks then scans that directory. If you need to limit the query to specific files, it is usually handled via: * Partitioning (to limit which directories are scanned). * Using the
FILES()
function instead of a formal External Table if the file list changes frequently. Summary: While StarRocks doesn't use a literal
List[Paths]
object (like a JSON array), you can achieve the same result using a comma-separated string in the
FILES()
function or by listing multiple strings in a
DATA INFILE
clause for Broker Loads. Does one of these methods fit the specific workflow you're building?
a
@Rocky getting following error -
Copy code
SELECT 
eventinfo
FROM FILES(
    "path" = "<gs://gcs-one-dsp-prod-eus-commons-adrr/prod/2026/03/01/01/adserv_servingfills_00-*.parquet>",
    "format" = "parquet"
)
LIMIT 10;

SQL Error [1064] [42000]: Apache Arrow type (nested) list does not match the type STRUCT in StarRocks: BE:10024
Any idea what's going one?
r
Hi there! Rocky here. It looks like you're hitting a type mismatch between how the Parquet file stores the
eventinfo
column and how StarRocks is inferring its schema. The error
Apache Arrow type (nested) list does not match the type STRUCT
typically happens when the
FILES
table function infers that a column should be a
STRUCT
, but the actual data in the Parquet file is structured as a
LIST
(Array), or vice versa. This often happens with complex nested data where Parquet uses the "3-level list" encoding. Here are a few steps to diagnose and fix this: 1. Check the Inferred Schema First, let's see what StarRocks thinks the schema is. Run this command:
Copy code
sql
DESCRIBE SELECT * FROM FILES(
    "path" = "<gs://gcs-one-dsp-prod-eus-commons-adrr/prod/2026/03/01/01/adserv_servingfills_00-*.parquet>",
    "format" = "parquet"
);
Look for the
eventinfo
column. If it shows as
STRUCT
but your data is actually an array of items, that's the conflict. 2. Verify the Parquet File Schema If you have access to
parquet-tools
or a tool like DuckDB, check the physical schema of the file. You want to see if
eventinfo
is defined as a
repeated
group (which is a list/array) or a
required/optional
group (which is a struct). 3. Explicitly Define the Schema (Recommended Fix) If the automatic inference is getting it wrong, you can manually define the columns and their types in the
FILES
function to match the Parquet file's actual structure. For example, if
eventinfo
is actually an ARRAY of STRUCTs, you should define it like this:
Copy code
sql
SELECT eventinfo
FROM FILES(
    "path" = "<gs://gcs-one-dsp-prod-eus-commons-adrr/prod/2026/03/01/01/adserv_servingfills_00-*.parquet>",
    "format" = "parquet",
    "columns" = "eventinfo ARRAY<STRUCT<field1 INT, field2 STRING>>" -- Adjust fields to match your actual data
)
LIMIT 10;
4. Check for Schema Evolution If you are querying a glob pattern (
adserv_servingfills_00-*.parquet
), it's possible that some files have
eventinfo
as a Struct and others as a List. StarRocks'
FILES
function infers the schema from a sample of files. If the files are inconsistent, you'll need to ensure the schema matches across all files or define a schema that is compatible. Quick Tip: If you just want to get the data moving and don't need to parse the nested fields immediately, you can try loading it as a
JSON
type if you are using an older version, though defining the correct
ARRAY
or
STRUCT
is the preferred way in newer StarRocks versions. Let me know if the
DESCRIBE
output shows anything unexpected!