Logo
Explore Help
Register Sign In
yujunjun/OpenMetadata
1
0
Fork 0
You've already forked OpenMetadata
mirror of https://github.com/open-metadata/OpenMetadata.git synced 2025-11-15 10:22:34 +00:00
Code Issues Packages Projects Releases Wiki Activity
OpenMetadata/ingestion/tests/integration/trino/data/only_complex.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
492 B
MySQL
Raw Normal View History

FIxes #16983: can't sample data from trino tables with complex types (#23478) * Update test data for `tests.integration.trino` This is to create tables with complex data types. Using raw SQL because creating tables with pandas didn't get the right types for the structs * Update tests to reproduce the issue Also included the new tables in the other tests to make sure complex data types do not break anything else Reference: [issue 16983](https://github.com/open-metadata/OpenMetadata/issues/16983) * Added `TypeDecorator`s handle `trino.types.NamedRowTuple` This is because pydantic couldn't figure out how to create python objects when receiving `NamedRowTuple`s, which broke the sampling process. This makes sure the data we receive from the trino interface is compatible with Pydantic
2025-09-26 08:13:28 +02:00
CREATE TABLE IF NOT EXISTS {catalog}.{schema}.{table_name} (
payload ROW(
foobar VARCHAR,
foobaz DOUBLE,
foos ARRAY(ROW(bars VARCHAR))
),
foobars ARRAY(VARCHAR)
);
INSERT INTO {catalog}.{schema}.{table_name} VALUES
(
ROW(
'test_value',
123.45,
ARRAY[ROW('bar1'), ROW('bar2')]
),
ARRAY['foo1', 'foo2', 'foo3']
),
(
ROW(
'another_value',
678.90,
ARRAY[ROW('bar3')]
),
ARRAY['foo4']
);
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.5 Page: 635ms Template: 14ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API