Hi,Ingest bigquery and add sharded_ table_ Pattern...
# ingestion
f
Hi,Ingest bigquery and add sharded_ table_ Pattern and the default value is used. An error is reported. Has anyone ever encountered it。@dazzling-judge-80093
Copy code
source:
  type: bigquery
  config:
    project_id: ${SOCIAL_INSIGHTS_BIGQUERY_ID}
    credential:
      project_id: ${SOCIAL_INSIGHTS_BIGQUERY_ID}
      private_key_id: ${SOCIAL_INSIGHTS_PRIVATE_KEY_ID}
      private_key: ${SOCIAL_INSIGHTS_PRIVATE_KEY}
      client_email: ${SOCIAL_INSIGHTS_CLIENT_EMAIL}
      client_id: ${SOCIAL_INSIGHTS_CLIENT_ID}
    sharded_table_pattern: ((.+)[_$])?(\d{4,10})$
    
sink: 
  type: datahub-rest
  config:
    server: ${DATAHUB_GMS}
    token: ${TOKEN}
h
Hi @full-chef-85630, could you share the error that is reported?
f
@helpful-optician-78938
Copy code
failures={'cube': ['Tables error: first argument must be string or compiled pattern'], 
'dedup': ['Tables error: first argument must be string or compiled pattern'], 
'logic': ['Tables error: first argument must be string or compiled pattern', 
'Views error: first argument must be string or compiled pattern'], 
'operation': ['Tables error: first argument must be string or compiled pattern'], 
'origin': ['Tables error: first argument must be string or compiled pattern'],
'test': ['Tables error: first argument must be string or compiled pattern'], 
'views': ['Tables error: first argument must be string or compiled pattern',
 'Views error: first argument must be string or compiled pattern']
h
I'll look into this and get back to you soon
Hi @full-chef-85630, could you enclose the pattern value in single quotes -
sharded_table_pattern: '((.+)[_$])?(\d{4,10})$'
?
f
@helpful-optician-78938 still not ,this parameter is a compilation problem
Copy code
from datahub.ingestion.run.pipeline import Pipeline

pip =Pipeline.create(config_dict={
	'source': {
		'type': 'bigquery',
		'config': {
			'project_id': '',
			'sharded_table_pattern': '((.+)[_$])?(\d{4,10})$',
			'credential': {
				'project_id': '',
				'private_key_id': '',
				'private_key': '',
				'client_email': '',
				'client_id': ''
			}
		}
	},
	'sink': {
		'type': 'datahub-rest',
		'config': {
			'server': '',
			'token': ''
		}
	}
})

pip.run()
pip.raise_from_status()
h
Looks like you are trying to supply the default value here. Can you try excluding it altogether from the config, so that the default gets used? cc: @dazzling-judge-80093
f
I want to implement custom, but I only use the default value after an error is reported @dazzling-judge-80093@loud-island-88694
h
Hi @full-chef-85630, it was not working for you because of a bug. Here is the PR with the fix. Once it is merged, you can try on the latest master.
f
thank you! I have identified the problem
d
We jus cut a new release which contains this fix it should show up on pypi soon
f
thank you
I retype the image and report an error:version 0.8.41 @dazzling-judge-80093
Copy code
01:59:36.622 [main] WARN  o.s.w.c.s.XmlWebApplicationContext:591 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.linkedin.gms.factory.common.GitVersionFactory]; nested exception is java.io.FileNotFoundException: class path resource [git.properties] cannot be opened because it does not exist
01:59:36.651 [main] ERROR o.s.web.context.ContextLoader:313 - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.linkedin.gms.factory.common.GitVersionFactory]; nested exception is java.io.FileNotFoundException: class path resource [git.properties] cannot be opened because it does not exist
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)