我正在尝试提交 spark-submit,但由于奇怪的消息而失败。
Error: Could not find or load main class org.apache.spark.launcher.Main
/opt/spark/bin/spark-class: line 96: CMD: bad array subscript
Run Code Online (Sandbox Code Playgroud)
这是我第一次看到这种错误。我试图检查 spark-class 文件的代码,但无法破译导致问题的原因。
# Turn off posix mode since it does not allow process substitution
set +o posix
CMD=()
DELIM=$'\n'
CMD_START_FLAG="false"
while IFS= read -d "$DELIM" -r ARG; do
if [ "$CMD_START_FLAG" == "true" ]; then
CMD+=("$ARG")
else
if [ "$ARG" == $'\0' ]; then
# After NULL character is consumed, change the delimiter and consume command string.
DELIM=''
CMD_START_FLAG="true"
elif [ …Run Code Online (Sandbox Code Playgroud) 我正在实施一个项目,在该项目中,结果将根据分数进行排序,并且在分数相同的情况下,结果集将根据日期字段进行排序。当分数相差 0.00001,即小数点的第 5 位或第 6 位时,就会出现问题。有什么方法可以将 Elasticsearch 中得出的分数四舍五入到小数点后第 4 位,以便二级排序可以对其进行处理。如果没有任何解决方法可以实现这一点。
谢谢阿希特
我正在尝试 shell 脚本编写,并尝试从 Json 中提取值并将其存储到变量中以供稍后使用。但我无法这样做,已尝试跟进大量链接和建议,可能我做错了什么。基本上我使用curl来点击url,并从响应中尝试提取状态字段的值。我正在尝试以下几行,
result=$(curl "http://localhost:9200/domains" | grep "status" | awk '{print $1 }')
echo "the result is" $result
卷曲命令将获取类似的内容
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"domains","index_uuid":"_na_","index":"domains"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"domains","index_uuid":"_na_","index":"domains"},"status":404}
Run Code Online (Sandbox Code Playgroud)
非常感谢在这方面的任何帮助。我知道我们可以用 jq 或 perl 来完成,但我正在寻找使用 grep、sed 或 awk 的解决方案。
谢谢阿希特