1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
# name: test/extension/autoloading_copy_function.test
# description: Tests for autoloading with copy functions
# group: [extension]
# This test assumes parquet to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO
require parquet
# Ensure we have a clean extension directory without any preinstalled extensions
statement ok
set extension_directory='__TEST_DIR__/autoloading_types'
### No autoloading nor installing: throw error with installation hint
statement ok
set autoload_known_extensions=false
statement ok
set autoinstall_known_extensions=false
statement maybe
copy (select 1337 as edgy_hacker_number) TO '__TEST_DIR__/test1337.parquet'
----
Catalog Error: Copy Function with name "parquet" is not in the catalog, but it exists in the parquet extension.
### With autoloading, install and correct repo
statement ok
set autoload_known_extensions=true
statement ok
set autoinstall_known_extensions=true
statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
statement ok
copy (select 1337 as edgy_hacker_number) TO '__TEST_DIR__/test1337.parquet'
query I
select * from '__TEST_DIR__/test1337.parquet';
----
1337
|