我是Spark SQL的新手,我正在尝试将字符串转换为spark数据框中的时间戳.我有一个'2017-08-01T02:26:59.000Z'名为time_string的列中的字符串
我将此字符串转换为时间戳的代码是
CAST (time_string AS Timestamp)
Run Code Online (Sandbox Code Playgroud)
但这给了我一个时间戳 2017-07-31 19:26:59
为什么要改变时间?有没有办法在不改变时间的情况下做到这一点?
谢谢你的帮助!
有没有人将Lombok 1.16与Dagger2一起使用?
我当前的代码如下:
@AllArgsConstructor(onConstructor = @__(@Inject))
public class JuiceMaker {
private final Apple apple;
Run Code Online (Sandbox Code Playgroud)
错误是:
JuiceMaker cannot be provided without an @Inject constructor or from an @Provides-annotated method.
Run Code Online (Sandbox Code Playgroud)
如果没有Lombok批注,这实际上可以工作,因此:
public class JuiceMaker {
private final Apple apple;
@Inject
public JuiceMaker(Apple apple){
this.apple = apple
}
}
Run Code Online (Sandbox Code Playgroud)
作品
是否可以在完成所有线程之前从启动线程的java方法返回?
这是我的代码:
import java.util.concurrent.*;
public class ExecutorSample {
public static void main(String[] args) {
ExecutorService service = Executors.newCachedThreadPool();
for (int i = 0; i < 10; i++) {
service.execute(() -> {
while (true) {
}
});
}
return;
}
}
Run Code Online (Sandbox Code Playgroud)
由于我不理解的某些原因,这不会返回.为什么主线程的返回受到工作线程卡住的影响?