数据流作业中出现空指针异常
SQL> Create or Replace Procedure Get_Serial( o_value out varchar2 ) Is
2 Begin
3 Select *
4 Into o_value
5 From (Select Max(Regexp_Substr('C507|C507', '[^|]+', 1, Level)) serial
6 From Dual
7 Connect By Level <= Length('C507|C507') -
8 Length(Replace('C507|C507', '|', '')) + 1);
9 End;
10 /
Procedure created
SQL> var serial varchar2;
SQL> exec Get_Serial(:serial);
PL/SQL procedure successfully completed
serial
---------
C507
一旦尝试建立管道,空指针将位于pipeline.run()。如果我将options.setRunner(DataflowRunner.class)更改为options.setRunner(DirectRunner.class),效果很好
以下是错误日志跟踪。
DataflowPipelineOptions options = PipelineOptionsFactory.
as(DataflowPipelineOptions.class);
options.setProject("myproject");
options.setStagingLocation("gs://labtmp/tmp");
options.setRunner(DataflowRunner.class);
options.setGcpTempLocation("gs://ibmlabtmp/tmp");
options.setGcpCredential(ServiceAccountCredentials.getApplicationDefault().
fromStream(new
FileInputStream("/My First Project-bcb4cc2bf1ad.json"))
.createScoped(Arrays.asList(new String[] {"https://www.googleapis.com/auth/cloud-platform"})));
options.setTempLocation("gs://labtmp/tmp");
options.setServiceAccount("616262334456-compute@developer.gserviceaccount.com");
options.setMaxNumWorkers(5);
options.setDiskSizeGb(500);
options.setWorkerMachineType("n1-standard-4");
options.setAutoscalingAlgorithm(AutoscalingAlgorithmType.THROUGHPUT_BASED);
options.setStreaming(false);
options.setJobName("myjob");
Pipeline pipeline = Pipeline.create(options);
sp.doProcessing(pipeline);
pipeline.run();