问题标签 [scala-shell]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
32 浏览

scala - 为什么scala shell中定义的类是public static

对我来说很奇怪 scala shell 中定义的类是 public static 但不是 public,我不知道为什么,有人知道吗?谢谢

0 投票
2 回答
778 浏览

scala - 从 Kafka 读取到 Flink Scala Shell

我正在尝试在 Flink(1.7.2)附带的 scala-shell 中连接到本地机器上的 Kafka(2.1)并从中读取。

这就是我正在做的事情:

之后,最后一条语句我收到以下错误:

我创建了名为“topic”的主题,并且能够通过另一个客户端正确地生成和读取消息。我正在使用 java 版本 1.8.0_201 并按照https://ci.apache.org/projects/flink/flink-docs-stable/dev/connectors/kafka.html的说明进行操作。

任何可能出现问题的帮助?

0 投票
1 回答
933 浏览

java - 线程“主”java.lang.NoClassDefFoundError中的scala EPFL异常:javax/script/Compilable

我完全是Scala和 JVM 编程的菜鸟。我最近加入的团队使用 scala 构建要在 Spark 上运行的程序。工作中的堆栈稳定且功能强大,但其复杂性与我在家的需求不匹配:仅具有功能性 scala shell以更熟悉该语言,尝试一下,在添加任何语法之前获得正确的语法“环境复杂性

[注意] 我只是想要一些与本文档相同的东西(所以,请不要根据编译器、sbt、IDE 等来回答)

这是我在吃贝壳时得到的

这似乎是一个经典问题,尽管我首先与我的系统上安装了Oracle java 11相关。但是,我认为我将 openjdk8 设置为默认的系统范围 JRE:

我错过了什么。不是 scala 使用/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java. 我正在使用Debian 9中提供的默认 scala 包

0 投票
1 回答
21 浏览

scala - 我无法在 scala-shell 中加载 myfile.scala

我有一个 Scala 文件,我想在 Scala Shell 上运行它。我正在使用以下命令:

load somepath\myfile.scala

在那个控制台告诉我之后:

用法: :load -v 文件

为什么我的文件无法运行?

0 投票
1 回答
87 浏览

apache-flink - 如何在 Apache flink 中启动和停止 flink scala-shell

如何在 apache flink 中启动和停止 flink scala-shell

我已经使用命令 /bin/start-scala-shell.sh local 启动了 flink scala shell。但不知道如何停止?

0 投票
0 回答
37 浏览

scala - 异常在 scala shell 中被截断

我在 scala shell 中运行了一些代码并得到以下错误。看起来异常被截断了,我无法得到 NPE 的根本原因。如何在 scala shell 中查看完整的堆栈跟踪?谢谢

0 投票
1 回答
129 浏览

scala - Executing Linux Command in Scala-Shell

I'm working on a project where I'm needing to execute some linux commands (sqoop command) in my Scala application. See sample command I tried executing with MySql on my VM.

I got the following error:

I used this command as well and I got same error message:

Can someone help me figure out what's cause of the error. I've tried using single quote and double quotes, all to no avail. I searched all over SO but I could not get any solution. That's why I'm posting here. NOTE: Same command successfully executed in pyspark as seen below:

0 投票
1 回答
98 浏览

scala - 如果我在 spark-shell (scala-shell) 中定义案例类,则构造函数签名会更改

我在 spark-shell 或 scala-shell 中定义了 case 类,发现它的构造函数签名发生了变化,增加了一个额外的参数$iw,那是什么?为什么会这样?此问题导致我无法通过其构造函数在反射中创建新实例