File: autoloading_copy_function.test

package info (click to toggle)
duckdb 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 564
file content (43 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download | duplicates (3)
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