You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since v0.3.2, SHOW CREATE TABLE doesn't fetch any values via dbt load_result()
Steps to reproduce:
Macros:
{% macro show_create_table2(relation) %}
{% call statement('show_create_table', fetch_result=True) %}
SELECT
create_table_query AS ddl
FROM system.tables
WHERE
name = '{{ relation.identifier }}' AND
database = '{{ relation.schema }}'
{% endcall %}
{% do return(load_result('show_create_table').table) %}
{% endmacro %}
{% macro show_create_table3(relation) %}
{% call statement('show_create_table', fetch_result=True) %}
SHOW CREATE TABLE {{ relation.schema }}.{{ relation.identifier }}
{% endcall %}
{% do return(load_result('show_create_table').table) %}
{% endmacro %}
then in python console:
import os
import time
from clickhouse_connect.driver import HttpClient
from dbt.adapters.clickhouse import ClickHouseAdapter, ClickHouseRelation
from dbt.adapters.factory import get_adapter_by_type
from dbt.contracts.connection import Connection
from dbt.contracts.relation import Path
from dbt.lib import get_dbt_config
from dbt.tests.util import get_connection
config = get_dbt_config('/usr/app/')
ch_adapter = ClickHouseAdapter(config)
adapter = get_adapter_by_type(ch_adapter.type())
with get_connection(adapter) as conn:
rel=adapter.get_relation(None, 'internal_analytics_src', 'src_dsas_datasources')
t1=adapter.execute_macro('show_create_table2', kwargs={"relation":rel})
t2=adapter.execute_macro('show_create_table3', kwargs={"relation":rel})
t2 is empty here, should be a table
I assume this is due to Handle queries that are actually commands, simply and clean up tests
But this command should load a table value, and it's counter-intuitive why it doesn't now.
The text was updated successfully, but these errors were encountered:
No, I thought it's relevant because of load_result. The macro I showed you is in dbt, albeit it's mine, sorry for the confusion, there's no such code in base dbt
Since v0.3.2, SHOW CREATE TABLE doesn't fetch any values via dbt load_result()
Steps to reproduce:
Macros:
then in python console:
t2 is empty here, should be a table
I assume this is due to
Handle queries that are actually commands, simply and clean up tests
But this command should load a table value, and it's counter-intuitive why it doesn't now.
The text was updated successfully, but these errors were encountered: