Lorin S.
Lorin S.

Reputation: 762

How do I SQL Query MinIO objects using the MinIO Client (mc)?

Getting into Minio. Investigating a few commands,

If I do mc ls alias/bucket then I get expected output:

[2020-12-09 19:48:15 UTC]    10B Account-9.dta
[2020-12-09 19:48:22 UTC]    10B Account-90.dta
[2020-12-09 19:48:22 UTC]    11B Account-92.dta

So, I would expect some kind of output when I execute the following on the same connection:

mc sql --recursive --query "select * from s3object" alias/bucket

but instead, it just goes back to a prompt (No results). I suspect my "from" is wrong but I have no idea what values to use other than "s3object".

How do I properly perform SQL queries on a local MinIO instance?

MinIO Version:

VERSION 2019-08-14T20:37:41Z MEMORY Used: 4.4 MB | Allocated: 3.6 GB | Used-Heap: 4.4 MB | Allocated-Heap: 65 MB PLATFORM Host: minio-66c9cd74c9-7m6lx | OS: linux | Arch: amd64 RUNTIME Version: go1.12.8 | CPUs: 12

MinIO Client Version:

mc version RELEASE.2020-11-25T23-04-07Z

Upvotes: 2

Views: 1385

Answers (1)

sh0dan
sh0dan

Reputation: 188

When you specify multiple objects, mc filters objects by extension.

If you store files with a .csv extension they should be picked up. Similar for .json files and gzip/bzip2.

Upvotes: 0

Related Questions