Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata ingestion fails for Bigquery - Invalid column name found in table partition #17098

Closed
alangeorge opened this issue Jul 19, 2024 · 0 comments · Fixed by #17104
Closed
Assignees
Labels
bug Something isn't working Ingestion

Comments

@alangeorge
Copy link

alangeorge commented Jul 19, 2024

Affected module
Ingestion Framework

Describe the bug
Metadata ingestion fails for Bigquery tables with case mismatch in partition column,

In the Bigquery console, If we check the table details,
On the schema tab, we have the partition column name in upper case, and on the details page it's in lower case.

schema_tab
idetails_tab

Error Log:

[2024-07-08 06:22:14.206027+00:00] {process_utils.py:190} INFO - [2024-07-08 06:22:14] DEBUG {metadata.Utils:execution_time_tracker:169} - Sink._run executed in 0.03s
[2024-07-08 06:22:14.206282+00:00] {process_utils.py:190} INFO - [2024-07-08 06:22:14] WARNING {metadata.Ingestion:status:76} - Failed to ingest CreateTableRequest [table_name] due to api request failure: Invalid column name found in table partition
[2024-07-08 06:22:14.206510+00:00] {process_utils.py:190} INFO - [2024-07-08 06:22:14] DEBUG {metadata.Ingestion:status:77} - Traceback (most recent call last):
[2024-07-08 06:22:14.206735+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/client.py", line 219, in _one_request
[2024-07-08 06:22:14.206787+00:00] {process_utils.py:190} INFO - resp.raise_for_status()
[2024-07-08 06:22:14.207037+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
[2024-07-08 06:22:14.207074+00:00] {process_utils.py:190} INFO - raise HTTPError(http_error_msg, response=self)
[2024-07-08 06:22:14.207471+00:00] {process_utils.py:190} INFO - requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://host_name/api/v1/tables
[2024-07-08 06:22:14.207543+00:00] {process_utils.py:190} INFO -
[2024-07-08 06:22:14.207568+00:00] {process_utils.py:190} INFO - The above exception was the direct cause of the following exception:
[2024-07-08 06:22:14.207575+00:00] {process_utils.py:190} INFO -
[2024-07-08 06:22:14.207709+00:00] {process_utils.py:190} INFO - Traceback (most recent call last):
[2024-07-08 06:22:14.207906+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/sink/metadata_rest.py", line 145, in _run
[2024-07-08 06:22:14.207974+00:00] {process_utils.py:190} INFO - return self._run_dispatch(record)
[2024-07-08 06:22:14.208155+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.208357+00:00] {process_utils.py:190} INFO - File "/opt/python3.11/lib/python3.11/functools.py", line 946, in _method
[2024-07-08 06:22:14.208480+00:00] {process_utils.py:190} INFO - return method.get(obj, cls)(*args, **kwargs)
[2024-07-08 06:22:14.208621+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.208853+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/sink/metadata_rest.py", line 136, in _run_dispatch
[2024-07-08 06:22:14.208930+00:00] {process_utils.py:190} INFO - return self.write_create_request(record)
[2024-07-08 06:22:14.209070+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.209299+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/sink/metadata_rest.py", line 166, in write_create_request
[2024-07-08 06:22:14.209443+00:00] {process_utils.py:190} INFO - created = self.metadata.create_or_update(entity_request)
[2024-07-08 06:22:14.209561+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.209803+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/ometa_api.py", line 276, in create_or_update
[2024-07-08 06:22:14.209906+00:00] {process_utils.py:190} INFO - return self._create(data=data, method="put")
[2024-07-08 06:22:14.210030+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.210236+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/ometa_api.py", line 267, in _create
[2024-07-08 06:22:14.210358+00:00] {process_utils.py:190} INFO - resp = fn(self.get_suffix(entity), data=data.json(encoder=show_secrets_encoder))
[2024-07-08 06:22:14.210555+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.210753+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/utils/execution_time_tracker.py", line 195, in inner
[2024-07-08 06:22:14.210791+00:00] {process_utils.py:190} INFO - result = func(*args, **kwargs)
[2024-07-08 06:22:14.210972+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.211059+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/client.py", line 298, in put
[2024-07-08 06:22:14.211160+00:00] {process_utils.py:190} INFO - return self._request("PUT", path, data)
[2024-07-08 06:22:14.211230+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.211434+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/client.py", line 193, in _request
[2024-07-08 06:22:14.211518+00:00] {process_utils.py:190} INFO - return self._one_request(method, url, opts, retry)
[2024-07-08 06:22:14.211692+00:00] {process_utils.py:190} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-07-08 06:22:14.211850+00:00] {process_utils.py:190} INFO - File "/tmp/venvv5kg8zna/lib/python3.11/site-packages/metadata/ingestion/ometa/client.py", line 237, in _one_request
[2024-07-08 06:22:14.211908+00:00] {process_utils.py:190} INFO - raise APIError(error, http_error) from http_error
[2024-07-08 06:22:14.212096+00:00] {process_utils.py:190} INFO - metadata.ingestion.ometa.client.APIError: Invalid column name found in table partition
[2024-07-08 06:22:14.212128+00:00] {process_utils.py:190} INFO -
[2024-07-08 06:22:14.212331+00:00] {process_utils.py:190} INFO - [2024-07-08 06:22:14] DEBUG {metadata.Utils:execution_time_tracker:169} - Sink executed in 0.03s
[2024-07-08 06:22:14.212460+00:00] {process_utils.py:190} INFO - [2024-07-08 06:22:14] DEBUG {metadata.Utils:execution_time_tracker:169} - Source executed in 0.0s

To Reproduce

Try to create a table using the python script attached below and do the ingestion

from google.cloud import bigquery

client = bigquery.Client()

dataset_id = 'test_openmetadata'
table_id = 'table_2'

schema = [
    bigquery.SchemaField('id', 'STRING', mode='REQUIRED'),
    bigquery.SchemaField('name', 'STRING', mode='REQUIRED'),
    bigquery.SchemaField('TRGT_DATE', 'DATE', mode='REQUIRED'),
    bigquery.SchemaField('value', 'FLOAT', mode='NULLABLE'),
]

table = bigquery.Table(f'{client.project}.{dataset_id}.{table_id}', schema=schema)
table.time_partitioning = bigquery.TimePartitioning(
    type_=bigquery.TimePartitioningType.DAY,
    field='trgt_date',  # The field used for partitioning
)

table = client.create_table(table)

print(f'Table {table.table_id} created with partitioning on {table.time_partitioning.field}')

Expected behavior
Able to ingest the tables with correct partition column name case present in the schema tab

Version:

  • Python version: 3.10
  • OpenMetadata version: 1.4.3
  • OpenMetadata Ingestion package version: 1.4.3
@OnkarVO7 OnkarVO7 self-assigned this Jul 19, 2024
@OnkarVO7 OnkarVO7 added bug Something isn't working Ingestion labels Jul 19, 2024
OnkarVO7 added a commit that referenced this issue Jul 22, 2024
…17104)

* Fixed case sensitive partiion col name bigquery

* update test
harshach pushed a commit that referenced this issue Jul 24, 2024
…17104)

* Fixed case sensitive partiion col name bigquery

* update test
pmbrull pushed a commit that referenced this issue Jul 30, 2024
* Add multiple owners

* Multi Ownership

* Issue #17012: Multi User/Team Ownership

* Issue #17012: Multi User/Team Ownership

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 1

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 2

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 3

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 4

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 5

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 6

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 7

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 8

* Add Migrations for Owner Thread

* update ingestion for multi owner

* fix pytests

* fixed checkstyle

* Add Alert Name to Publishers (#17108)

* Add Alert Name to Publishers

* Fix Test

* Add Bound to Setuptools (#17105)

* Minor: fixed testSummaryGraph issue (#17115)

* feat: updated multi pipeline ui as per new mock (#17106)

* feat: updated multi pipeline ui as per new mock

* translation sync

* fixed failing unit test

* fixed playwright test

* fixed viewService click issue

* sorted pipeline based on test case length

* Added domo federated dataset support (#17061)

* fix usernames (#17122)

* Doc: Updated Doris & Redshift Docs (#17123)

Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local>

* Fix #12677: Added Synapse Connector - docs and side docs (#17041)

* Fix #17098: Fixed case sensitive partition column name in Bigquery (#17104)

* Fixed case sensitive partiion col name bigquery

* update test

* #13876: change placement of comment and close button in task approval workflow (#17044)

* change placment of comment and close button in task approval workflow

* minor change

* playwright test for the close and comment function

* supported ref in activityFeedEditor

* fix playwright test

* added playwright test for data steward

* fix the test for the data streward user

* fix the close button not showing if task has no suggestions and icon fixes

* fix sonar issue

* change glossary and add suggestion button to dropdown button

* fix the glossary failure due to button change

* icon change for add tag and description

* fix glossary cypress failure due to button chnages

* changes as per comments

* MINOR: docs links fix (#17125)

* alation link fix

* dbt yaml config source link fix

* bigquery doc fix

* Explore tree feedbacks (#17078)

* fix explore design

* update switcher icon

* show menu when search query exists

* fix selection of active service

* fix type error

* fix tests

* fix tests

* fix tests

* MINOR: Databricks view TableType fix (#17124)

* Minor: fixed AUT test (#17128)

* Fix #16692: Override Lineage Support for View & Dashboard Lineage (#17064)

* #17065: fix the tags not rendering in selector after selection in edit tags task (#17107)

* fix the tags not rendering in selector after selection in edit tags taks

* added playwright test

* minor changes

* minor fix

* fix the tags not updating in edit and accept tag

* fix explore type changes for collate (#17131)

* MINOR: changed log level to debug (#17126)

* changed log level to debug

* fixed type

* changed type to optional

* Get feed and count data of soft deleted user (#17135)

* Doc: Adding OIDC Docs (#17139)

Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local>

* Doc: Updating Profiler Workflow Docs URL (#17140)

Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local>

* fix playwright and cypress (#17138)

* Minor: fixed edit modal issue for sql test case (#17132)

* Minor: fixed edit modal issue for sql test case

* fixed test

* Minor: Added whats new content for 1.4.6 release (#17148)

* MINOR [GEN-799]: add option to disable manual trigger using scheduleType (#17031)

* fix: raise for triggering system app

* added scheduleType ScheduledOrManual

* minor: remove "service" field from required properties in createAPIEndpoint schema (#17147)

* initial commit multi ownership

* update glossary and other entities

* update owners

* fix version pages

* fix tests

* Update entity_extension to move owner to array (#17200)

* fix tests

* fix api page errors

* fix owner label design

* locales

* fix owners in elastic search source

* fix types

* fix tests

* fix tests

* Updated CustomMetric owner to entityReferenceList. (#17211)

* Fix owners field in search mappings

* fix search aggregates

* fix inherited label

* Issue #17012: Multi User/Team Ownership - Fix Tests - Part 9

* Fix QUeries

* Fix Mysql Queries

* Typo

* fix tests

* fix tests

* fix tests

* fix advanced search constants

* fix service ingestion tests

* fix tests

---------

Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com>
Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com>
Co-authored-by: Ayush Shah <ayush@getcollate.io>
Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
Co-authored-by: k.nakagaki <141020064+nakaken-churadata@users.noreply.github.com>
Co-authored-by: Prajwal214 <167504578+Prajwal214@users.noreply.github.com>
Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local>
Co-authored-by: Suman Maharana <sumanmaharana786@gmail.com>
Co-authored-by: Ashish Gupta <ashish@getcollate.io>
Co-authored-by: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com>
Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com>
Co-authored-by: Imri Paran <imri.paran@gmail.com>
Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com>
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
Co-authored-by: karanh37 <karanh37@gmail.com>
Co-authored-by: Siddhant <86899184+Siddhanttimeline@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ingestion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants