witty-painting-90923
02/25/2022, 4:03 PMcurl http://<datahub-gms-endpoint>/config is saying statefulIngestionCapable: true so it should be fine
we have
gms v0.8.26
datahub cli v0.8.26.3
Any help would be much appreciated, thank you!
pipeline = Pipeline.create(
# This configuration is analogous to a recipe configuration.
{
"source": {
"type": "postgres",
"config": {
"env": ENV,
"host_port": sql_host_port,
"database": database,
"username": sql_login,
"password": sql_password,
"include_views": False,
"profiling": {
"enabled": True
},
"stateful_ingestion": {
"enabled": True,
"remove_stale_metadata": True,
"state_provider": {
"type": "datahub",
"config": {"datahub_api": {"server": datahub_host}},
},
},
},
},
"pipeline_name": "my_postgres_pipeline_1",
"sink": {
"type": "datahub-rest",
"config": {"server": datahub_host},
},
}
)loud-island-88694
hundreds-photographer-13496
03/01/2022, 9:03 AMnumerous-application-54063
03/01/2022, 11:30 AMnumerous-application-54063
03/01/2022, 11:31 AM[2022-03-01 11:14:05,369] {process_utils.py:143} INFO - INFO:datahub.ingestion.source.state_provider.datahub_ingestion_checkpointing_provider:Querying for the latest ingestion checkpoint for pipelineName:'bigquery_ingestion', platformInstanceId:'bigquery_no_host_port_no_database', job_name:'common_ingest_from_sql_source'
[2022-03-01 11:14:05,386] {process_utils.py:143} INFO - INFO:datahub.ingestion.source.state_provider.datahub_ingestion_checkpointing_provider:The last committed ingestion checkpoint for pipelineName:'bigquery_ingestion', platformInstanceId:'bigquery_no_host_port_no_database', job_name:'common_ingest_from_sql_source' found with start_time: 2022-03-01 11:07:52.115000+00:00 and a bucket duration of None.
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - --- Logging error ---
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - Traceback (most recent call last):
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/state/checkpoint.py", line 96, in create_from_checkpoint_aspect
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - config_obj = config_class.parse_obj(config_as_dict)
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - File "pydantic/main.py", line 511, in pydantic.main.BaseModel.parse_obj
[2022-03-01 11:14:05,391] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/sql/bigquery.py", line 253, in __init__
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - super().__init__(**data)
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "pydantic/main.py", line 329, in pydantic.main.BaseModel.__init__
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "pydantic/main.py", line 1022, in pydantic.main.validate_model
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "pydantic/fields.py", line 847, in pydantic.fields.ModelField.validate
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "pydantic/fields.py", line 1118, in pydantic.fields.ModelField._apply_validators
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "pydantic/class_validators.py", line 280, in pydantic.class_validators._generic_validator_cls.lambda3
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/sql/bigquery.py", line 273, in bigquery_doesnt_need_platform_instance
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - "BigQuery project ids are globally unique. You do not need to specify a platform instance."
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO - datahub.configuration.common.ConfigurationError: BigQuery project ids are globally unique. You do not need to specify a platform instance.
[2022-03-01 11:14:05,392] {process_utils.py:143} INFO -
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - During handling of the above exception, another exception occurred:
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO -
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - Traceback (most recent call last):
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - File "/usr/local/lib/python3.6/logging/__init__.py", line 994, in emit
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - msg = self.format(record)
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - File "/usr/local/lib/python3.6/logging/__init__.py", line 840, in format
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - return fmt.format(record)
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - File "/usr/local/lib/python3.6/logging/__init__.py", line 577, in format
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - record.message = record.getMessage()
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - File "/usr/local/lib/python3.6/logging/__init__.py", line 338, in getMessage
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - msg = msg % self.args
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - TypeError: not all arguments converted during string formatting
[2022-03-01 11:14:05,393] {process_utils.py:143} INFO - Call stack:
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/script.py", line 46, in <module>
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - res = read_and_execute_datahub_recipe(*arg_dict["args"], **arg_dict["kwargs"])
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/script.py", line 43, in read_and_execute_datahub_recipe
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - pipeline.run()
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/run/pipeline.py", line 182, in run
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - self.source.get_workunits(), 10 if self.preview_mode else None
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/sql/bigquery.py", line 655, in get_workunits
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - for wu in super().get_workunits():
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/sql/sql_common.py", line 675, in get_workunits
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - yield from self.gen_removed_entity_workunits()
[2022-03-01 11:14:05,394] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/sql/sql_common.py", line 524, in gen_removed_entity_workunits
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - self.get_default_ingestion_job_id(), BaseSQLAlchemyCheckpointState
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/state/stateful_ingestion_base.py", line 195, in get_last_checkpoint
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - job_id, checkpoint_state_class
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/state/stateful_ingestion_base.py", line 179, in _get_last_checkpoint
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - state_class=checkpoint_state_class,
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - File "/tmp/venvnpwplmm7/lib/python3.6/site-packages/datahub/ingestion/source/state/checkpoint.py", line 100, in create_from_checkpoint_aspect
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - "Failed to construct checkpoint's config from checkpoint aspect.", e
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - Message: "Failed to construct checkpoint's config from checkpoint aspect."
[2022-03-01 11:14:05,395] {process_utils.py:143} INFO - Arguments: (ConfigurationError('BigQuery project ids are globally unique. You do not need to specify a platform instance.',),)
[2022-03-01 11:14:05,396] {process_utils.py:143} INFO - INFO:datahub.ingestion.run.pipeline:Processing commit request for DatahubIngestionCheckpointingProvider. Commit policy = CommitPolicy.ON_NO_ERRORS, has_errors=False, has_warnings=False
[2022-03-01 11:14:05,396] {process_utils.py:143} INFO - INFO:datahub.ingestion.source.state_provider.datahub_ingestion_checkpointing_provider:Committing ingestion checkpoint for pipeline:'bigquery_ingestion',instance:'bigquery_no_host_port_no_database', job:'common_ingest_from_sql_source'
[2022-03-01 11:14:05,402] {process_utils.py:143} INFO - INFO:datahub.ingestion.source.state_provider.datahub_ingestion_checkpointing_provider:Committed ingestion checkpoint for pipeline:'bigquery_ingestion',instance:'bigquery_no_host_port_no_database', job:'common_ingest_from_sql_source'
[2022-03-01 11:14:05,402] {process_utils.py:143} INFO - INFO:datahub.ingestion.run.pipeline:Successfully committed changes for DatahubIngestionCheckpointingProvider.numerous-application-54063
03/01/2022, 11:33 AMpipeline_name: "bigquery_ingestion"
source:
type: bigquery
config:
project_id: project_id
credential:
project_id: "${GOOGLE_CREDENTIALS_PROJECT_ID}"
private_key_id: "${GOOGLE_CREDENTIALS_PRIVATE_KEY_ID}"
private_key: "${GOOGLE_CREDENTIALS_PRIVATE_KEY}"
client_email: "${GOOGLE_CREDENTIALS_CLIENT_EMAIL}"
client_id: "${GOOGLE_CREDENTIALS_CLIENT_ID}"
include_table_lineage: False
stateful_ingestion:
enabled: True
remove_stale_metadata: True
state_provider:
type: "datahub"
config:
datahub_api:
server: ${DATAHUB_GMS_ENDPOINT}
sink:
type: datahub-rest
config:
server: ${DATAHUB_GMS_ENDPOINT}
transformers:
- type: "add_dataset_properties"
config:
add_properties_resolver_class: "common_tasks.datahub.custom_transformers.bq_property_resolver.BQPropertiesResolver"gentle-hamburger-31302
03/02/2022, 8:26 AM{
search(input: {type: DATASET, query: "*", start: 0, count: 10}) {
start
count
total
searchResults {
entity {
urn
type
... on Dataset {
name
status {
removed
}
}
}
}
}
}
6. Click on play button (It is above the top-left panel, first button)
7. You will see output in right panel
8. Copy the URN of table t1. Consider the URN is urnlidataset: (urnlidataPlatform:postgres,foo.public.t1,DEV)
9. Go to postgres database foo
10. Delete the table t1
11. Run the ingestion again
12. Go to GMS graphql endpoint http//<DATAHUB GMS ENDPOINT>9002/api/graphiql
13. Paste below query in top-left panel. Replace the urnlidataset:(urnlidataPlatform:postgres,foo.public.t1,DEV) by urn value you have captured in step 8.
{
dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:postgres,foo.public.t1,DEV)") {
urn
type
status {
removed
}
}
}
14. Click on the play button, you can see the removed value is set to true.
cc: @elegant-doctor-86344. @loud-island-88694numerous-application-54063
03/02/2022, 10:16 AMbland-orange-95847
03/02/2022, 10:25 AMnumerous-application-54063
03/02/2022, 10:36 AMbig-carpet-38439
03/02/2022, 4:47 PMloud-island-88694
bland-orange-95847
03/02/2022, 5:46 PMnumerous-application-54063
03/02/2022, 7:16 PM"schema_pattern": {
"deny": ["information_schema"]
}
So i can confirm that postgres is working, and bigquery is a separate issue.
my bad, i was missing some logs. Thank you for the support on this one, i will look after for updates on the bigquery issue.gentle-hamburger-31302
03/02/2022, 7:27 PMhelpful-optician-78938
03/02/2022, 8:25 PM