小编col*_*inD的帖子

使用服务主体从 DataBricks 连接到 Synapse

我正在尝试使用服务主体从 Databricks 连接到 Synapse。我已经在集群配置中配置了服务主体

fs.azure.account.auth.type.<datalake>.dfs.core.windows.net OAuth
fs.azure.account.oauth.provider.type org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
fs.azure.account.oauth2.client.id <Service Principal ID/Application ID>
fs.azure.account.oauth2.client.secret <Client secret key/Service Principal Password>
fs.azure.account.oauth2.client.endpoint https://login.microsoftonline.com/<tenant-id>/oauth2/token
fs.azure.createRemoteFileSystemDuringInitialization true
Run Code Online (Sandbox Code Playgroud)

虽然我可以成功连接到 DataLake 并工作,但当我使用以下命令时,我无法写入突触......

DummyDF.write.format("com.databricks.spark.sqldw")\
.mode("append")\
.option("url", jdbcUrl)\
.option("useAzureMSI", "true")\
.option("tempDir",tempdir)\
.option("dbTable", "DummyTable").save()
Run Code Online (Sandbox Code Playgroud)

我收到以下错误...

Py4JJavaError: An error occurred while calling o831.save.
: com.databricks.spark.sqldw.SqlDWSideException: SQL DW failed to execute the JDBC query produced by the connector.
Underlying SQLException(s):
com.microsoft.sqlserver.jdbc.SQLServerException: External file access failed due to internal error: 'Error occurred while accessing HDFS: Java exception raised on call to HdfsBridge_IsDirExist. …
Run Code Online (Sandbox Code Playgroud)

azure-databricks azure-synapse azure-service-principal

5
推荐指数
1
解决办法
3603
查看次数

不贪心并且可选的逗号分割整个字符串

我有以下字符串:\n[Example] \xc3\xb6\xc3\xa4\xc3\xbc\xc3\x9f asdf 1234 (1a\xc3\xb6) (not necessary),

\n

解释:

\n

[Example] 可选,不需要

\n

\xc3\xb6\xc3\xa4\xc3\xbc\xc3\x9f asdf 1234我需要的最重要的部分。每个字符、数字、特殊字符以及德语字符都\xc3\xa4\xc3\x84\xc3\xb6\xc3\x96\xc3\xbc\xc3\x9c\xc3\x9f可以在这里找到。
\n贪婪选择可能是防止像德国字符这样的字符的最佳解决方案,对吗?

\n

(1a\xc3\xb6)可选和必需的

\n

(not necessary)可选,不需要。如果出现的话可能是(not ...)或者(unusual)

\n

,逗号也可以是可选的。但也不需要。

\n

我使用以下正则表达式:/(?:\\[.*\\]\\s)?(?<name>.*?)(?:\\s\\([not|unusual].*?\\))?\\,/g

\n

问题:

\n
    \n
  1. 当我在逗号处使用可选参数时,?它将整个字符串拆分为单独的字符。

    \n
  2. \n
  3. 当我将组中的非贪婪选择更改name为贪婪选择时,可选逗号被分隔。但现在从 开始的示例字符串\xc3\xb6被选择到最后。

    \n
  4. \n
  5. 第一个标准括号内的字符串()可以以大写或小写开头。目前我只能识别大写字母。

    \n
  6. \n
\n

这是我对 regex101 的尝试,其中包含一堆示例: https: //regex101.com/r/Lx2anw/1

\n

很抱歉问了一个非常具体的问题,但我已经以我的知识结束了......

\n

有人对我在这里可以做什么有什么建议吗?

\n

javascript regex

5
推荐指数
3
解决办法
118
查看次数

DevOps 管道 Replace() 函数未按预期工作

我正在尝试在 DevOps 管道中使用替换函数,如https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#replace中所述

对于以下 yml,我期望输出为This Should be Steak but it is Steak,但实际输出为This Should be Steak but it is Beef

variables:
  foo: 'beef'
  bar: $[replace('$(foo)', 'beef', 'steak')]

pool:
  vmImage: 'ubuntu-latest'
steps:
- script: echo This should be steak but it is $(bar)
Run Code Online (Sandbox Code Playgroud)

我也尝试过这会产生相同的输出

variables:
  foo: 'beef'

pool:
  vmImage: 'ubuntu-latest'
steps:
- script: echo This should be steak but it is ${{ replace('$(foo)', 'beef', 'steak') }}
Run Code Online (Sandbox Code Playgroud)

yaml azure-devops azure-pipelines

1
推荐指数
1
解决办法
6726
查看次数