duckdb / duckdb-web

DuckDB website and documentation
https://duckdb.org
MIT License
160 stars 300 forks source link

Issue found on page 'Secrets Manager' #3018

Closed renbud closed 3 months ago

renbud commented 3 months ago

Please describe the problem you encountered in the DuckDB documentation and include the "Page URL" link shown below. Note: only create an issue if you wish to report a problem with the DuckDB documentation. For questions about DuckDB or the use of certain DuckDB features, use GitHub Discussions, Stack Overflow, or Discord.

Page URL: https://duckdb.org/docs/configuration/secrets_manager.html

FROM which_secret('s3://my-other-bucket/file.parquet', 's3');

is not working because it is not a table valued function. It is a scalar function. You need to

SELECT which_secret('s3://my-other-bucket/file.parquet', 's3');
szarnyasg commented 3 months ago

Hi @renbud, which version are you using? In version 1.0.0, which_secret is a table function:

v1.0.0 1f98600c2c
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
select function_name, function_type from duckdb_functions() where function_name = 'which_secret';
┌───────────────┬───────────────┐
│ function_name │ function_type │
│    varchar    │    varchar    │
├───────────────┼───────────────┤
│ which_secret  │ table         │
└───────────────┴───────────────┘
v1.0.0 1f98600c2c
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D from duckdb_functions() where function_name = 'which_secret';
┌───────────────┬──────────────┬─────────────┬───────────────┬───────────────┬───┬──────────┬──────────────┬─────────┬───────────┐
│ database_name │ database_oid │ schema_name │ function_name │ function_type │ … │ internal │ function_oid │ example │ stability │
│    varchar    │   varchar    │   varchar   │    varchar    │    varchar    │   │ boolean  │    int64     │ varchar │  varchar  │
├───────────────┼──────────────┼─────────────┼───────────────┼───────────────┼───┼──────────┼──────────────┼─────────┼───────────┤
│ system        │ 0            │ main        │ which_secret  │ table         │ … │ true     │           48 │ NULL    │ NULL      │
├───────────────┴──────────────┴─────────────┴───────────────┴───────────────┴───┴──────────┴──────────────┴─────────┴───────────┤
│ 1 rows                                                                                                    18 columns (9 shown) │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Run Time (s): real 0.043 user 0.040010 sys 0.001433
D select function_name, function_type from duckdb_functions() where function_name = 'which_secret';
┌───────────────┬───────────────┐
│ function_name │ function_type │
│    varchar    │    varchar    │
├───────────────┼───────────────┤
│ which_secret  │ table         │
└───────────────┴───────────────┘
renbud commented 3 months ago

Hi @szarnyasg , I am using duckdb from DBeaver. It looks like my driver is out of date. I am updating it now. You can ignore this issue, thanks.

SELECT version() 

Results in ''' v0.10.2

and

from duckdb_functions() where function_name = 'which_secret';


results in
'''
|database_name|database_oid|schema_name|function_name|function_type|description                                                          |comment|return_type|parameters     |parameter_types      |varargs|macro_definition|has_side_effects|internal|function_oid|example                                               |stability |
|-------------|------------|-----------|-------------|-------------|---------------------------------------------------------------------|-------|-----------|---------------|---------------------|-------|----------------|----------------|--------|------------|------------------------------------------------------|----------|
|system       |0           |main       |which_secret |scalar       |Print out the name of the secret that will be used for reading a path|       |VARCHAR    |['path','type']|['VARCHAR','VARCHAR']|       |                |false           |true    |1,064       |which_secret('s3://some/authenticated/path.csv', 's3')|CONSISTENT|

'''
szarnyasg commented 3 months ago

I see! The problem is the API change between 0.10 and v1.0, which was incorrectly reflected in the documentation. I submitted a fix - it will de deployed in 10 minutes.