Arrow returns null catalog_name

Hi,
I have a small java program to retrieve all tables from my Dremio cloud server but catalog_name is always null. I expected “Nessie-Source” or “Samples” to be my catalog name. Is this not correct? Do I need to create a catalog with Dremio, and if so, how? I need to populate this catalog_name field.

Result of the program:

ResultSchema: Schema<catalog_name: Utf8, db_schema_name: Utf8, table_name: Utf8 not null, table_type: Utf8 not null>
RowCount: 16
catalog_name	db_schema_name	table_name	table_type
null	Nessie-Source.cs-test	map_example	TABLE
null	Nessie-Source.gp-test	struct_type_double	TABLE
null	Nessie-Source.gp-test	struct_type_single	TABLE
null	Nessie-Source.gp-test	test_person	TABLE
null	Nessie-Source.gp-test	test_varchar	TABLE
null	Nessie-Source.ss-test	testFloat	TABLE
null	Nessie-Source.ss-test	testMap	TABLE
null	Nessie-Source.ss-test	testTable	TABLE
null	Nessie-Source.ss-test	testVarchar1	TABLE
null	Samples.samples.dremio.com	NYC-taxi-trips-iceberg	TABLE
null	Samples.samples.dremio.com.Dremio University	googleplaystore.csv	TABLE
null	Samples.samples.dremio.com.tpcds_sf1000	web_sales	TABLE

Snippet of java program:

FlightInfo info = flightSqlClient.getTables(null, null, null, null, false, credentialCallOption);
        info.getEndpoints().forEach(endpoint -> {
            try (FlightStream stream = flightSqlClient.getStream(endpoint.getTicket(), credentialCallOption)) {
                while (stream.next()) {
                    try (VectorSchemaRoot vectorSchemaRoot = stream.getRoot()) {
                        if (vectorSchemaRoot != null) {
                            // Print the schema
                            System.out.println("ResultSchema: " + vectorSchemaRoot.getSchema());
                            System.out.println("RowCount: " + vectorSchemaRoot.getRowCount());
                            System.out.println(vectorSchemaRoot.contentToTSVString());
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
1 Like

balaji.ramaswamy Could you provide help here? Thanks!

I expected “Nessie-Source” or “Samples” to be my catalog name. Is this not correct?

This is not correct. Dremio only has a single catalog which is why it is null here. Sources (as configured in Dremio) are not the same as catalogs in Dremio. For a table identifier, the source name will always be the first part in the schema. Also note that Dremio supports nested folders which most database do not. As a result, a table or view’s schema can get pretty long.