StarRocks / dbt-starrocks

dbt-starrocks contains all of the code enabling dbt to work with StarRocks
20 stars 8 forks source link

dbt tutorial my_first_dbt_model doesn't work with StarRocks #23

Open alberttwong opened 9 months ago

alberttwong commented 9 months ago

Stuck at step 5. https://docs.getdbt.com/guides/manual-install?step=5

(dbt-env) atwong@Albert-CelerData jaffle_shop % dbt run
23:59:46  Running with dbt=1.6.2
23:59:46  Registered adapter: starrocks=1.4.2
23:59:46  Unable to do partial parsing because profile has changed
23:59:46  Found 2 models, 4 tests, 0 sources, 0 exposures, 0 metrics, 335 macros, 0 groups, 0 semantic models
23:59:46
23:59:46  Concurrency: 1 threads (target='dev')
23:59:46
23:59:46  1 of 2 START sql table model testing.my_first_dbt_model ........................ [RUN]
23:59:46  1 of 2 ERROR creating sql table model testing.my_first_dbt_model ............... [ERROR in 0.05s]
23:59:46  2 of 2 SKIP relation testing.my_second_dbt_model ............................... [SKIP]
23:59:46
23:59:46  Finished running 1 table model, 1 view model in 0 hours 0 minutes and 0.18 seconds (0.18s).
23:59:46
23:59:46  Completed with 1 error and 0 warnings:
23:59:46
23:59:46    Compilation Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
  '>' not supported between instances of 'int' and 'str'

  > in macro starrocks__create_table_as (macros/materializations/models/table.sql)
  > called by macro create_table_as (macros/materializations/models/table/create_table_as.sql)
  > called by macro default__get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro statement (macros/etc/statement.sql)
  > called by macro materialization_table_default (macros/materializations/models/table/table.sql)
  > called by model my_first_dbt_model (models/example/my_first_dbt_model.sql)
23:59:46
23:59:46  Done. PASS=0 WARN=0 ERROR=1 SKIP=1 TOTAL=2
alberttwong commented 8 months ago

I see the PR merged but the dbt-starrocks connector hasn't be updated with the latest. https://pypi.org/project/dbt-starrocks/#history

hhhonzik commented 8 months ago

same issue here, would be great if this gets resolved as i can't create any tables / materialized_views in my dbt project.

alberttwong commented 8 months ago
(dbt-env) atwong@Albert-CelerData jaffle_shop % dbt run -d
22:02:23  Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10190d190>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10511c580>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10511c490>]}
22:02:23  Running with dbt=1.6.10
22:02:23  running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': '/Users/atwong/.dbt', 'fail_fast': 'False', 'version_check': 'True', 'log_path': '/Users/atwong/sandbox/dbt-tutorial/jaffle_shop/logs', 'debug': 'True', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'invocation_command': 'dbt run -d', 'target_path': 'None', 'introspect': 'True', 'send_anonymous_usage_stats': 'True'}
22:02:23  Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x105163580>]}
22:02:23  Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x105530070>]}
22:02:23  Registered adapter: starrocks=1.6.0
22:02:23  checksum: 28908e88b83a05550f08d8d5005b031bfd1e6cf5c944d3c74469cec401f04961, vars: {}, profile: , target: , version: 1.6.10
22:02:23  Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
22:02:23  Partial parsing enabled, no changes found, skipping parsing
22:02:23  Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1056b50d0>]}
22:02:23  Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10567bc70>]}
22:02:23  Found 2 models, 4 tests, 0 sources, 0 exposures, 0 metrics, 338 macros, 0 groups, 0 semantic models
22:02:23  Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1055fc220>]}
22:02:23
22:02:23  Acquiring new starrocks connection 'master'
22:02:23  Acquiring new starrocks connection 'list_schemas'
22:02:23  Using starrocks connection "list_schemas"
22:02:23  On list_schemas: /* {"app": "dbt", "dbt_version": "1.6.10", "profile_name": "jaffle_shop", "target_name": "dev", "connection_name": "list_schemas"} */
select distinct schema_name from information_schema.schemata
22:02:23  Opening a new connection, currently in state init
22:02:23  SQL status: SUCCESS 4 in 0.0 seconds
22:02:23  On list_schemas: Close
22:02:23  Re-using an available connection from the pool (formerly list_schemas, now list_None_testing)
22:02:23  Using starrocks connection "list_None_testing"
22:02:23  On list_None_testing: BEGIN
22:02:23  Opening a new connection, currently in state closed
22:02:23  SQL status: SUCCESS 0 in 0.0 seconds
22:02:23  Using starrocks connection "list_None_testing"
22:02:23  On list_None_testing: /* {"app": "dbt", "dbt_version": "1.6.10", "profile_name": "jaffle_shop", "target_name": "dev", "connection_name": "list_None_testing"} */

    select
      null as "database",
      tbl.table_name as name,
      tbl.table_schema as "schema",
      case when tbl.table_type = 'BASE TABLE' then 'table'
           when tbl.table_type = 'VIEW' and mv.table_name is null then 'view'
           when tbl.table_type = 'VIEW' and mv.table_name is not null then 'materialized_view'
           when tbl.table_type = 'SYSTEM VIEW' then 'system_view'
           else 'unknown' end as table_type
    from information_schema.tables tbl
    left join information_schema.materialized_views mv
    on tbl.TABLE_SCHEMA = mv.TABLE_SCHEMA
    and tbl.TABLE_NAME = mv.TABLE_NAME
    where tbl.table_schema = 'testing'

22:02:24  SQL status: SUCCESS 0 in 0.0 seconds
22:02:24  On list_None_testing: ROLLBACK
22:02:24  On list_None_testing: Close
22:02:24  Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1056a1d30>]}
22:02:24  Using starrocks connection "master"
22:02:24  On master: BEGIN
22:02:24  Opening a new connection, currently in state init
22:02:24  SQL status: SUCCESS 0 in 0.0 seconds
22:02:24  On master: COMMIT
22:02:24  Using starrocks connection "master"
22:02:24  On master: COMMIT
22:02:24  SQL status: SUCCESS 0 in 0.0 seconds
22:02:24  On master: Close
22:02:24  Concurrency: 1 threads (target='dev')
22:02:24
22:02:24  Began running node model.jaffle_shop.my_first_dbt_model
22:02:24  1 of 2 START sql table model testing.my_first_dbt_model ........................ [RUN]
22:02:24  Re-using an available connection from the pool (formerly list_None_testing, now model.jaffle_shop.my_first_dbt_model)
22:02:24  Began compiling node model.jaffle_shop.my_first_dbt_model
22:02:24  Writing injected SQL for node "model.jaffle_shop.my_first_dbt_model"
22:02:24  Timing info for model.jaffle_shop.my_first_dbt_model (compile): 15:02:24.024689 => 15:02:24.030388
22:02:24  Began executing node model.jaffle_shop.my_first_dbt_model
22:02:24  Opening a new connection, currently in state closed
22:02:24  Timing info for model.jaffle_shop.my_first_dbt_model (execute): 15:02:24.030982 => 15:02:24.071785
22:02:24  On model.jaffle_shop.my_first_dbt_model: Close
22:02:24  Compilation Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
  '>' not supported between instances of 'int' and 'str'

  > in macro starrocks__create_table_as (macros/materializations/models/table.sql)
  > called by macro create_table_as (macros/materializations/models/table/create_table_as.sql)
  > called by macro default__get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro statement (macros/etc/statement.sql)
  > called by macro materialization_table_default (macros/materializations/models/table/table.sql)
  > called by model my_first_dbt_model (models/example/my_first_dbt_model.sql)
22:02:24  Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '668cc995-a88e-452d-abab-4e1df267fe5a', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1056fb7f0>]}
22:02:24  1 of 2 ERROR creating sql table model testing.my_first_dbt_model ............... [ERROR in 0.05s]
22:02:24  Finished running node model.jaffle_shop.my_first_dbt_model
22:02:24  Began running node model.jaffle_shop.my_second_dbt_model
22:02:24  2 of 2 SKIP relation testing.my_second_dbt_model ............................... [SKIP]
22:02:24  Finished running node model.jaffle_shop.my_second_dbt_model
22:02:24  Using starrocks connection "master"
22:02:24  On master: BEGIN
22:02:24  Opening a new connection, currently in state closed
22:02:24  SQL status: SUCCESS 0 in 0.0 seconds
22:02:24  On master: COMMIT
22:02:24  Using starrocks connection "master"
22:02:24  On master: COMMIT
22:02:24  SQL status: SUCCESS 0 in 0.0 seconds
22:02:24  On master: Close
22:02:24  Connection 'master' was properly closed.
22:02:24  Connection 'model.jaffle_shop.my_first_dbt_model' was properly closed.
22:02:24
22:02:24  Finished running 1 table model, 1 view model in 0 hours 0 minutes and 0.17 seconds (0.17s).
22:02:24  Command end result
22:02:24
22:02:24  Completed with 1 error and 0 warnings:
22:02:24
22:02:24    Compilation Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
  '>' not supported between instances of 'int' and 'str'

  > in macro starrocks__create_table_as (macros/materializations/models/table.sql)
  > called by macro create_table_as (macros/materializations/models/table/create_table_as.sql)
  > called by macro default__get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro get_create_table_as_sql (macros/materializations/models/table/create_table_as.sql)
  > called by macro statement (macros/etc/statement.sql)
  > called by macro materialization_table_default (macros/materializations/models/table/table.sql)
  > called by model my_first_dbt_model (models/example/my_first_dbt_model.sql)
22:02:24
22:02:24  Done. PASS=0 WARN=0 ERROR=1 SKIP=1 TOTAL=2
22:02:24  Command `dbt run` failed at 15:02:24.096283 after 0.31 seconds
22:02:24  Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10190d190>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x105530340>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1056f02b0>]}
22:02:24  Flushing usage events
alberttwong commented 8 months ago

FYI @MarkovWangRR

alberttwong commented 8 months ago

@hhhonzik I'm testing some fixes on a 1.6 release of the adapter. I'm hoping it'll be released later this week.

alberttwong commented 8 months ago

fail at step 5 of tutorial. https://github.com/StarRocks/dbt-starrocks/issues/38