DuckDB is an analytical in-process SQL database management system http://www.duckdb.org
  • C++ 76.6%
  • sql 17%
  • Python 2.6%
  • C 1.7%
  • Julia 0.9%
  • Other 1%
Find a file
Mark 4820e7a557
Populate is_generated and generation_expression in information_schema.columns (#22757)
### Summary
information_schema.columns has always exposed is_generated and
generation_expression columns (as required by the SQL standard), but
both were hardcoded as NULL::VARCHAR which makes them unusable for
discovering generated columns.

This PR fixes that by:
- Adding is_generated (BOOLEAN) and generation_expression (VARCHAR) to
the `duckdb_columns` table function, sourced from the existing
ColumnDefinition::Generated() and
ColumnDefinition::GeneratedExpression() internals
- Wiring information_schema.columns to use these real values:
is_generated returns 'ALWAYS' or 'NEVER' (consistent with PostgreSQL),
and generation_expression returns the expression string for generated
columns and NULL otherwise
### Before
```
CREATE TABLE t (
             i INT,
             j INT GENERATED ALWAYS AS (i + 1),
             k VARCHAR DEFAULT 'hello'
         );

SELECT column_name, is_generated, generation_expression
FROM information_schema.columns WHERE table_name = 't';
-- is_generated and generation_expression are always NULL
```
### After
```
SELECT column_name, is_generated, generation_expression
FROM information_schema.columns WHERE table_name = 't';
-- i  | NEVER  | NULL
-- j  | ALWAYS | CAST((i + 1) AS INTEGER)
-- k  | NEVER  | NULL
```
### Testing
Extended test/sql/generated_columns/virtual/gcol_duckdb_columns.test
with assertions covering both duckdb_columns and
information_schema.columns.
2026-06-03 19:29:15 +02:00
.github Fix skewness() test failure and stabilize main CI (#23030) 2026-06-03 14:15:28 +00:00
benchmark Merge branch 'main' into window-batch 2026-05-26 09:58:56 -07:00
data Merge branch 'v1.5-variegata' into merge-v15-main 2026-04-25 15:24:56 +02:00
examples Fix OSX release error: 'fmt/format.h' file not found 2026-06-01 13:35:55 +02:00
extension Fix skewness() test failure for machine epsilon difference on macOS 2026-06-03 13:23:12 +02:00
logo README: Display different logo for light/dark mode 2024-03-26 18:03:50 +01:00
scripts Move valgrind CI job with increased timeout to NightlyTests 2026-06-03 14:07:17 +02:00
src Populate is_generated and generation_expression in information_schema.columns (#22757) 2026-06-03 19:29:15 +02:00
test Populate is_generated and generation_expression in information_schema.columns (#22757) 2026-06-03 19:29:15 +02:00
third_party Async Thread Pool / Task Queue (#23002) 2026-06-03 10:54:23 +00:00
tools Merge branch 'main' into shellhistory 2026-06-03 14:43:33 +02:00
.clang-format remove empty lines at the start of blocks 2025-10-28 09:00:51 +01:00
.clang-tidy Make clang-tidy checks easier to read 2026-04-20 10:49:45 +02:00
.clangd Disable clang-tidy checks for some excluded dirs 2026-04-20 10:49:19 +02:00
.codecov.yml second round of renames 2023-08-21 15:42:32 +02:00
.editorconfig removed some more references to r client 2023-09-05 07:42:12 +02:00
.gitattributes Let GitHub render *.test files as SQL 2025-03-06 10:10:24 +01:00
.gitignore rework task scheduler, split into multiple pools and queues 2026-05-28 17:03:48 +02:00
.sanitizer-leak-suppressions.txt And text pool 2025-01-27 12:57:06 +01:00
.sanitizer-thread-suppressions.txt Remove redundant part lock guard for sort_key_payload_state 2026-05-21 10:02:28 +02:00
AI_POLICY.md add ai policy 2026-06-03 11:21:13 +02:00
CITATION.cff Update CITATION.cff 2021-07-28 11:31:36 +02:00
CLAUDE.md Add support for includes and variables in sqllogic test files 2026-05-28 11:33:16 +02:00
CMakeLists.txt Build jemalloc for loadable extensions when EXTENSION_TESTS_ONLY=1 2026-05-21 10:30:00 +02:00
CODE_OF_CONDUCT.md fix typos and spelling errors 2023-07-13 17:41:59 -04:00
CONTRIBUTING.md No typo fix PRs please 2026-05-14 13:16:32 +02:00
Doxyfile Fix typos in errors and comments 2026-04-22 08:53:31 +02:00
DuckDBConfig.cmake.in Don't require icu unless extension is enabled 2025-11-27 07:49:14 +01:00
DuckDBConfigVersion.cmake.in Add cmake install targets 2019-11-07 16:42:16 +01:00
LICENSE Update copyright year 2026-01-26 18:01:34 +01:00
Makefile Improve test runner (#23004) 2026-06-02 12:08:11 +00:00
README.md Update Labs URL 2026-05-27 13:28:57 +02:00
SECURITY.md Update Labs URL 2026-05-27 13:28:57 +02:00

DuckDB logo

Github Actions Badge discord Latest Release

DuckDB

DuckDB is a high-performance analytical database system. It is designed to be fast, reliable, portable, and easy to use. DuckDB provides a rich SQL dialect with support far beyond basic SQL. DuckDB supports arbitrary and nested correlated subqueries, window functions, collations, complex types (arrays, structs, maps), and several extensions designed to make SQL easier to use.

DuckDB is available as a standalone CLI application and has clients for Python, R, Java, Wasm, etc., with deep integrations with packages such as pandas and dplyr.

For more information on using DuckDB, please refer to the DuckDB documentation.

Installation

If you want to install DuckDB, please see our installation page for instructions.

Data Import

For CSV files and Parquet files, data import is as simple as referencing the file in the FROM clause:

SELECT * FROM 'myfile.csv';
SELECT * FROM 'myfile.parquet';

Refer to our Data Import section for more information.

SQL Reference

The documentation contains a SQL introduction and reference.

Development

For development, DuckDB requires CMake, Python 3 and a C++17 compliant compiler. In the root directory, run make to compile the sources. For development, use make debug to build a non-optimized debug version. You should run make unit and make allunit to verify that your version works properly after making changes. To test performance, you can run BUILD_BENCHMARK=1 BUILD_TPCH=1 make and then perform several standard benchmarks from the root directory by executing ./build/release/benchmark/benchmark_runner. The details of benchmarks are in our Benchmark Guide.

Please also refer to our Build Guide and Contribution Guide.

Support

See the Support Options page and the dedicated endoflife.date page.