我正在使用Oracle 11g我在使用查询时出现此错误:
select count(*) from potluck;
Run Code Online (Sandbox Code Playgroud)
所以当我使用时:
select count(*) from "potluck";
Run Code Online (Sandbox Code Playgroud)
每个人都好......请告诉我为什么?谢谢
我遇到了 cassandra 容器的情况。
我在不同的文件夹中有 2 个 docker-compse.yaml 文件。
文件夹 1 中的 docker-compose.yaml
version: "3"
services:
cassandra-cluster-node-1:
image: cassandra:3.0
container_name: cassandra-cluster-node-1
hostname: cassandra-cluster-node-1
ports:
- '9142:9042'
- '7199:7199'
- '9160:9160'
Run Code Online (Sandbox Code Playgroud)
文件夹 2 中的 docker-compose.yaml
version: "3"
services:
cassandra-cluster-node-2:
image: cassandra:3.0
container_name: cassandra-cluster-node-2
hostname: cassandra-cluster-node-2
ports:
- '9242:9042'
- '7299:7199'
- '9260:9160'
Run Code Online (Sandbox Code Playgroud)
我尝试在文件夹1上启动cassandra,系统运行良好,之后我在文件夹2上启动cassandra。但是此时,文件夹1上的服务cassandra被自动终止。所以我不明白他们的意思,请问有使用过Docker经验的人可以帮我解释一下这种情况吗?
运行 cassandra_2 后 cassandra_1 出现错误
cassandra-cluster-node-1 exited with code 137
Run Code Online (Sandbox Code Playgroud)
谢谢您,我将非常感谢您的帮助。
我有一个像这样的例子:
def demo(a: Int, b: Int, c:Int): Int = {
if (a == 1)
return 10
if (b == 2)
return 20
if (c == 3)
return 30
40
}
Run Code Online (Sandbox Code Playgroud)
代码运行良好,但我知道在Scala中我们试图避免返回.所以我想问一下,有什么不同的方法可以避免回报?谢谢
编辑 这是我得到的真实案例,我想避免回归.
post("/") {
if (product_id <= 0)
return BadRequest(Map("ERROR" -> "PRODUCT_ID IS WRONG"))
if (file_id.isEmpty())
return BadRequest(Map("ERROR" -> "FILE ID NOT FOUND"))
if (data_type.isEmpty())
return BadRequest(Map("ERROR" -> "FILE TYPE NOT FOUND"))
if (data_type.get != "cvs")
return BadRequest(Map("ERROR" -> "FILE TYPE IS WRONG"))
OK(Map("SUCCESS" -> "THANK YOU")) …Run Code Online (Sandbox Code Playgroud) 我已经在Try上阅读了有关transform方法的信息,并将此方法与其他方法进行比较,以找出哪种方法更易于编码。我给你看下面的代码
val value: Try[Int] = Try("1".toInt)
.transform(f => Success(f), e => Success(0))
val value2: Try[Int] = Try("1".toInt) match {
case Success(f) => Success(f)
case Failure(e) => Success(0)
}
val value3: Try[Int] = Try("1".toInt)
.map(f => f)
.recover {
case e: Exception => 0
}
Run Code Online (Sandbox Code Playgroud)
我想知道在这些情况下哪个会更好,为什么呢?
谢谢
code-cleanup ×2
coding-style ×2
scala ×2
cassandra ×1
docker ×1
oracle ×1
performance ×1
return ×1
return-value ×1
try-catch ×1