OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Trino Profiler Ingestion Failing

Open aimen-denche opened this issue 1 year ago • 8 comments

Affected module Does it impact the UI, backend or Ingestion Framework? -- Ingestion

Describe the bug A clear and concise description of what the bug is. -- Column validaiton failing in trino profiler

To Reproduce

Screenshots or steps to reproduce:

Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/profiler/interface/sqlalchemy/profiler_interface.py", line 406, in compute_metrics_in_thread
    row = self._get_metric_fn[metric_func.metric_type.value](
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/profiler/interface/sqlalchemy/stored_statistics_profiler.py", line 125, in _compute_table_metrics
    super().get_table_statistics(stat_metrics, schema, table_name)
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/ingestion/source/database/trino/profiler/system_tables_profiler.py", line 109, in get_table_statistics
    table_stats = self._get_cached_stats(schema, table_name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/ingestion/source/database/trino/profiler/system_tables_profiler.py", line 138, in _get_cached_stats
    stats = self._get_db_stats(schema, table)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/ingestion/source/database/trino/profiler/system_tables_profiler.py", line 152, in _get_db_stats
    columns_dict = {
                   ^
  File "/home/airflow/.local/lib/python3.11/site-packages/metadata/ingestion/source/database/trino/profiler/system_tables_profiler.py", line 153, in <dictcomp>
    row.get("column_name"): ColumnStats(**row) for row in column_rows
                            ^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/pydantic/main.py", line 193, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 8 validation errors for ColumnStats
low_value.int
  Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='false', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/int_parsing
low_value.float
  Input should be a valid number, unable to parse string as a number [type=float_parsing, input_value='false', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/float_parsing
low_value.datetime
  Input should be a valid datetime or date, input is too short [type=datetime_from_date_parsing, input_value='false', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/datetime_from_date_parsing
low_value.decimal
  Input should be a valid decimal [type=decimal_parsing, input_value='false', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/decimal_parsing
high_value.int
  Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='true', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/int_parsing
high_value.float
  Input should be a valid number, unable to parse string as a number [type=float_parsing, input_value='true', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/float_parsing
high_value.datetime
  Input should be a valid datetime or date, input is too short [type=datetime_from_date_parsing, input_value='true', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/datetime_from_date_parsing
high_value.decimal
  Input should be a valid decimal [type=decimal_parsing, input_value='true', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/decimal_parsing

Expected behavior A clear and concise description of what you expected to happen.

Version:

  • OS: [e.g. iOS]
  • Python version:
  • OpenMetadata version: [e.g. 0.8] : 1.6.8
  • OpenMetadata Ingestion package version: [e.g. openmetadata-ingestion[docker]==XYZ] 1.6.8

Additional context Add any other context about the problem here.

aimen-denche avatar Apr 15 '25 15:04 aimen-denche

DDL TABLE : Image

aimen-denche avatar Apr 16 '25 07:04 aimen-denche

Sample Data :

Image

aimen-denche avatar Apr 16 '25 07:04 aimen-denche

hey @ayush-shah I have a question regarding the Trino profiler bug. Last time, you mentioned that the fix would be included in the 1.7.1 release. However, I just noticed that it has been removed from 1.7.1 and pushed to 1.8.0. This means the fix won’t be available in 1.7.1 anymore, correct?

The issue is that we are currently blocked from continuing our work in OpenMetadata because the profiler is not functional. We were relying on the 1.7.1 fix to move forward, so this delay is putting significant pressure on our timeline. Could you please confirm if there is any workaround or if there’s still a chance to prioritize this bug earlier? Thanks a lot for your help — it’s critical for us

aimen-denche avatar Apr 28 '25 13:04 aimen-denche

Hey @aimendenche-nw, since it is not possible in 1.7.1, we will have that available in a minor release post that so somewhere around 1.7.1.2 or 1.7.2

ayush-shah avatar Apr 28 '25 13:04 ayush-shah

hey @ayush-shah Thanks for your answer! Is there any way to accelerate this fix, or to ensure it will be delivered in the very next minor release (and not postponed further)? ( and also provide a clear time estimation please)!

We really need a confirmed timeline here because our project delivery depends on it. Thanks a lot for your support!

aimen-denche avatar Apr 28 '25 13:04 aimen-denche

Hey @aimendenche-nw, I was taking a look at this issue and couldn't reproduce your error. I used the screenshots you provided to create the same structure and test it but it is working fine.

Can you provide me more context?

  • How are you running the profiler? Through the UI or using YAML files in an external process?
  • Do you have the complete logs while running it on debug perhaps?

Also

  • Trino version (I've used the lastest docker image)
  • Catalog you're using behind it (I've used latest postgresql docker image)
  • Maybe if you could share the proper DDL for the table so that I can create it AS IS
  • Also some INSERT statements to mimic exactly what you have.

If you want you can reach me on the OpenMetadata slack: @Pablo Takara

IceS2 avatar May 14 '25 14:05 IceS2

@aimendenche-nw pleae provide the feedback for above. Thanks

harshach avatar May 24 '25 17:05 harshach

closing as we have not heard anything in over a month.

TeddyCr avatar Jul 03 '25 11:07 TeddyCr