Google Cloud Bigtable에 데이터를 채워야하며 데이터 소스가 Google BigQuery입니다.Google BigQuery에서 Google Cloud Bigtable로 데이터를로드하는 방법
운동으로 나는 read the data from BigQuery 수 있으며 별도의 운동으로 나는 write data into Bigtable as well 수 있습니다.
이제이 두 가지 작업을 하나의 Google Cloud Dataflow 작업에 결합해야합니다. 모든 예는 큰 도움이 될 것입니다. 를 참조 할 수 있습니다 미래에 빅 테이블에 BigQuery에 데이터를 변환하고자하는 사람들을 위해
Pipeline p = Pipeline.create(options);
.apply(BigQueryIO.Read.from("some_table"))
.apply(ParDo.of(new DoFn<TableRow, Row>() {
public void processElement(ProcessContext c) {
Row output = somehowConvertYourDataToARow(c.element());
c.output(output);
}
})
.apply(BigtableIO.Write.withTableId("some_other_table");
CloudBigtableIO.initializeForWrite(p); \t \t p.apply(BigQueryIO.Read.fromQuery(getQuery())) \t \t .apply(ParDo.of(new DoFn() { \t \t \t public void processElement(ProcessContext c) { \t \t \t Mutation output = convertDataToRow(c.element()); \t \t \t c.output(output); \t \t \t } \t \t \t })) \t \t \t .apply(CloudBigtableIO.writeToTable(config));
– Amandeep하지만 다음과 같은 예외 java.lang.IllegalArgumentException를 가지고 : 엘을 인코딩 할 수 없음을 코더 'HBaseMutationCoder'로 'null'로 설정하십시오. – Amandeep
코드에서 어딘가에 보이는 것처럼, Bigtable 작성자가 허용하지 않는 null 값을 생성합니다. 돌연변이 로깅을 시도하여이 돌연변이 또는 그 구성 요소가 null인지 확인하고 convertDataToRow 함수가 null을 생성 할 수 없는지 확인하십시오 – danielm