Skip to content

Trino is not returning the results for alluxio based tables #25768

@pasalkarsachin1

Description

@pasalkarsachin1

I have created a alluxio backed external table

trino:abc> CREATE TABLE IF NOT EXISTS test (
                   ->  metadata varchar,
                   ->  day integer,
                   ->  batch bigint
                   -> )
                   -> WITH (
                   -> format = 'PARQUET',
                   -> external_location = 'alluxio:///transit/data/abc/test',
                   -> partitioned_by = ARRAY[ 'day','batch']
                   -> );

when show create table called

trino:abc> show create table test;
ERROR: failed to open pager: Cannot run program "less": error=2, No such file or directory
                                    Create Table
-------------------------------------------------------------------------------------
 CREATE TABLE cat.abc.test (
    metadata varchar,
    day integer,
    batch bigint
 )
 WITH (
    external_location = 'alluxio:/transit/data/abc/test',
    format = 'PARQUET',
    partitioned_by = ARRAY['day','batch']
 )
(1 row)

Query 20250512_071224_29725_gnu6a, FINISHED, 1 node

You see table created here is with alluxio:/ & not alluxio:///

When I inserted data into table metastore has entry like

         TBL_NAME          |               PART_NAME               | PART_ID |  SD_ID  |                                                LOCATION

---------------------------+---------------------------------------+---------+---------+--------------------------------------------------------------------------------------------------
 test                      | day=20250507/batch=1746579600         | 3651169 | 3677017 | alluxio:/transit/data/abc/test/day=20250507/batch=1746579600

While reading this data https://github.com/trinodb/trino/blob/master/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/DirectoryListingFilter.java#L72 gets called where we check directory equivalant in this case parent is returned as

alluxio:///transit/data/abc/test/day=20250507/batch=1746579600

and prefix

alluxio:/transit/data/abc/test/day=20250507/batch=1746579600

https://github.com/trinodb/trino/blob/master/lib/trino-filesystem/src/main/java/io/trino/filesystem/Locations.java#L39 this checks for location which are different it should check scheme & path than location

Some of the logs

2025-05-08T12:07:29.341Z	INFO	hive-231	io.trino.plugin.hive.fs.DirectoryListingFilter	parent alluxio:///transit/data/abc/test/day=20250507/batch=1746579600
2025-05-08T12:07:29.341Z	INFO	hive-231	io.trino.plugin.hive.fs.DirectoryListingFilter	prefix alluxio:/transit/data/abc/test/day=20250507/batch=1746579600
2025-05-08T12:07:29.341Z	INFO	hive-231	io.trino.plugin.hive.fs.DirectoryListingFilter	directChild is null

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions