正则表达式模式在 Airbyte 的文件连接器中有效吗?

Does regex pattern work in Airbyte's file connector?

提问人:knightcool 提问时间:11/15/2023 更新时间:11/15/2023 访问量:26

问:

我已经能够使用 Airbyte 的文件连接器成功地将单个 jsonl 文件中的记录同步到我的目标目的地(Google Big Query)。但是,我的实际要求是将多个 jsonl 文件同步到它们自己的目标表。

例:

file1.jsonl

{"contactId": "437056000000645001", "firstName": "John", "lastName": "Doe", "event": "CONTACT.CREATED"}
{"contactId": "437056000000645047", "firstName": "Amy", "lastName": "Lynn1", "event": "CONTACT.DELETED"}
{"contactId": "437056000000645070", "firstName": "John", "lastName": "Doe", "event": "CONTACT.DELETED"}
{"contactId": "437056000000645093", "firstName": "John", "lastName": "Doe", "event": "CONTACT.CREATED"}
{"contactId": "437056000000645093", "firstName": "John", "lastName": "Doe", "event": "CONTACT.DELETED"}
{"contactId": "437056000000645116", "firstName": "Amy", "lastName": "Chu", "event": "CONTACT.CREATED"}
{"contactId": "437056000000645128", "firstName": "JOhn", "lastName": "D", "event": "CONTACT.CREATED"}
{"contactId": "437056000000645116", "firstName": "Amy", "lastName": "Chu", "event": "CONTACT.DELETED"}
{"contactId": "437056000000645128", "firstName": "JOhn", "lastName": "D", "event": "CONTACT.DELETED"}

file2.jsonl

{"dealId": "437056000000661027", "dealName": "test deal1", "event": "DEAL.CREATED"}
{"dealId": "437056000000661027", "dealName": "test deal1", "event": "DEAL.CREATED"}
{"dealId": "437056000000661027", "dealName": "test deal1", "event": "DEAL.DELETED"}

请注意,每个 jsonl 文件都有其唯一的 json 架构。这 2 个 jsonl 文件存储在同一个目录中,如下所示:

/airbyte/integration_code/local/file1.jsonl

/airbyte/integration_code/local/file2.jsonl

现在,当我在 Airbyte 中配置文件连接器时,我提供了 URL 字段,我希望 Airbyte 读取目录中的两个 jsonl 文件,获取它们的架构,规范化并将它们同步到目标。但是,源设置本身失败并出现错误file:///airbyte/integration_code/local/*.jsonllocal

Configuration check failed Failed to load file:///airbyte/integration_code/local/*.jsonl. You could have provided an invalid URL, please verify it: FileNotFoundError(2, 'No such file or directory').

而不是正则表达式文件格式,如果我使用实际的文件名,它效果很好。但是,此 Airbyte 文档显示“在”配置“选项卡中,在”文件路径“字段中输入 JSON 文件的路径。如果有多个名称相似的文件,也可以指定文件模式。

有没有人能够成功使用文件模式而不是实际文件名?

JSON 正则表达式 AirByte

评论

1赞 Wiktor Stribiżew 11/15/2023
*.jsonl不是正则表达式,它是一个球。如果你真的需要一个正则表达式,它必须是.*\.jsonl
0赞 knightcool 11/16/2023
也尝试了建议的正则表达式,但它给出了相同的错误。
0赞 knightcool 11/16/2023
Airbyte 的另一个文档说:“这个源为目标文件生成一个表,因为它目前一次只复制一个文件 docs.airbyte.com/integrations/sources/file
0赞 Wiktor Stribiżew 11/16/2023
我没有看到任何支持正则表达式甚至 glob 的地方。

答: 暂无答案