You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhilinli123 (via GitHub)" <gi...@apache.org> on 2023/08/07 06:51:44 UTC

[GitHub] [seatunnel] zhilinli123 opened a new pull request, #5234: [Improve][hbase] The specified column is written to the specified column family

zhilinli123 opened a new pull request, #5234:
URL: https://github.com/apache/seatunnel/pull/5234

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     3. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve][hbase] The specified column is written to the specified column family [seatunnel]

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#issuecomment-2175603012

   PTAL: @Hisoka-X @EricJoy2048 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] zhilinli123 commented on a diff in pull request #5234: [Improve][hbase] The specified column is written to the specified column family

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#discussion_r1288662236


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/sink/HbaseSinkWriter.java:
##########
@@ -128,8 +129,13 @@ private Put convertRowToPut(SeaTunnelRow row) {
                         .collect(Collectors.toList());
         for (Integer writeColumnIndex : writeColumnIndexes) {
             String fieldName = seaTunnelRowType.getFieldName(writeColumnIndex);
-            String familyName =
-                    hbaseParameters.getFamilyNames().getOrDefault(fieldName, defaultFamilyName);
+            // This is the family of columns that we define to be written through the.conf file
+            Map<String, String> configurationFamilyNames = hbaseParameters.getFamilyNames();
+            String familyName = configurationFamilyNames.getOrDefault(fieldName, defaultFamilyName);
+            if (!configurationFamilyNames.containsKey(ALL_COLUMNS)

Review Comment:
   Hbase:2.5.1
   ```
   hbase:002:0> desc 'mytable'
   Table mytable is ENABLED                                                                                                                                                       
   mytable, {TABLE_ATTRIBUTES => {METADATA => {'hbase.store.file-tracker.impl' => 'DEFAULT'}}}                                                                                    
   COLUMN FAMILIES DESCRIPTION                                                                                                                                                    
   {NAME => 'cf1', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATI
   ON_SCOPE => '0', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536 B (64KB)'}                                       
   
   {NAME => 'cf2', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATI
   ON_SCOPE => '0', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536 B (64KB)'}                                       
   
   ```
   Sink conf:
   ```
   sink {
     Hbase {
       zookeeper_quorum = "127.0.0.1:2181"
       table = "mytable"
       rowkey_column = ["id"]
       family_name {
         sex = "cf1"
         c_double="cf2"
         c_bigint="cf2"
       }
     }
   }
   ```
   Class:org.apache.seatunnel.example.flink.v2.SeaTunnelApiExample
   Console Error Log:
   ```
   Caused by: org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
   	at org.apache.flink.runtime.jobmaster.JobResult.toJobExecutionResult(JobResult.java:144)
   	at org.apache.flink.runtime.minicluster.MiniClusterJobClient.lambda$getJobExecutionResult$3(MiniClusterJobClient.java:137)
   	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
   	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
   	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
   	at org.apache.flink.runtime.rpc.akka.AkkaInvocationHandler.lambda$invokeRpc$0(AkkaInvocationHandler.java:237)
   	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
   	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
   	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
   	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
   	at org.apache.flink.runtime.concurrent.FutureUtils$1.onComplete(FutureUtils.java:1081)
   	at akka.dispatch.OnComplete.internal(Future.scala:264)
   	at akka.dispatch.OnComplete.internal(Future.scala:261)
   	at akka.dispatch.japi$CallbackBridge.apply(Future.scala:191)
   	at akka.dispatch.japi$CallbackBridge.apply(Future.scala:188)
   	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:36)
   	at org.apache.flink.runtime.concurrent.Executors$DirectExecutionContext.execute(Executors.java:73)
   	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:44)
   	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:252)
   	at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:572)
   	at akka.pattern.PipeToSupport$PipeableFuture$$anonfun$pipeTo$1.applyOrElse(PipeToSupport.scala:22)
   	at akka.pattern.PipeToSupport$PipeableFuture$$anonfun$pipeTo$1.applyOrElse(PipeToSupport.scala:21)
   	at scala.concurrent.Future$$anonfun$andThen$1.apply(Future.scala:436)
   	at scala.concurrent.Future$$anonfun$andThen$1.apply(Future.scala:435)
   	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:36)
   	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
   	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
   	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
   	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
   	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
   	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
   	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
   	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
   	at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
   	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
   	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
   	at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
   Caused by: org.apache.flink.runtime.JobException: Recovery is suppressed by NoRestartBackoffTimeStrategy
   	at org.apache.flink.runtime.executiongraph.failover.flip1.ExecutionFailureHandler.handleFailure(ExecutionFailureHandler.java:138)
   	at org.apache.flink.runtime.executiongraph.failover.flip1.ExecutionFailureHandler.getFailureHandlingResult(ExecutionFailureHandler.java:82)
   	at org.apache.flink.runtime.scheduler.DefaultScheduler.handleTaskFailure(DefaultScheduler.java:216)
   	at org.apache.flink.runtime.scheduler.DefaultScheduler.maybeHandleTaskFailure(DefaultScheduler.java:206)
   	at org.apache.flink.runtime.scheduler.DefaultScheduler.updateTaskExecutionStateInternal(DefaultScheduler.java:197)
   	at org.apache.flink.runtime.scheduler.SchedulerBase.updateTaskExecutionState(SchedulerBase.java:682)
   	at org.apache.flink.runtime.scheduler.SchedulerNG.updateTaskExecutionState(SchedulerNG.java:79)
   	at org.apache.flink.runtime.jobmaster.JobMaster.updateTaskExecutionState(JobMaster.java:435)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcInvocation(AkkaRpcActor.java:305)
   	at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcMessage(AkkaRpcActor.java:212)
   	at org.apache.flink.runtime.rpc.akka.FencedAkkaRpcActor.handleRpcMessage(FencedAkkaRpcActor.java:77)
   	at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleMessage(AkkaRpcActor.java:158)
   	at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:26)
   	at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:21)
   	at scala.PartialFunction$class.applyOrElse(PartialFunction.scala:123)
   	at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:21)
   	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
   	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)
   	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)
   	at akka.actor.Actor$class.aroundReceive(Actor.scala:517)
   	at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:225)
   	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:592)
   	at akka.actor.ActorCell.invoke(ActorCell.scala:561)
   	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:258)
   	at akka.dispatch.Mailbox.run(Mailbox.scala:225)
   	at akka.dispatch.Mailbox.exec(Mailbox.scala:235)
   	... 4 more
   Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 5 actions: org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException: Column family value does not exist in region mytable,,1691407060742.8342aec5f86243f424a77083303ae40e. in table 'mytable', {TABLE_ATTRIBUTES => {METADATA => {'hbase.store.file-tracker.impl' => 'DEFAULT'}}}, {NAME => 'cf1', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536 B (64KB)'}, {NAME => 'cf2', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536 B (64KB)'}
   	at org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:1081)
   	at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicBatchOp(RSRpcServices.java:951)
   	at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:916)
   	at org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2892)
   	at org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:45039)
   	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:387)
   	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124)
   	at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:102)
   	at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:82)
   : 5 times, servers with issues: localhost,16020,1691592648669
   	at org.apache.hadoop.hbase.client.BatchErrors.makeException(BatchErrors.java:54)
   	at org.apache.hadoop.hbase.client.AsyncRequestFutureImpl.getErrors(AsyncRequestFutureImpl.java:1196)
   	at org.apache.hadoop.hbase.client.BufferedMutatorImpl.doFlush(BufferedMutatorImpl.java:303)
   	at org.apache.hadoop.hbase.client.BufferedMutatorImpl.close(BufferedMutatorImpl.java:235)
   	at org.apache.seatunnel.connectors.seatunnel.hbase.sink.HbaseSinkWriter.close(HbaseSinkWriter.java:106)
   	at org.apache.seatunnel.translation.flink.sink.FlinkSinkWriter.close(FlinkSinkWriter.java:91)
   	at org.apache.flink.streaming.runtime.operators.sink.AbstractSinkWriterOperator.dispose(AbstractSinkWriterOperator.java:103)
   	at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:864)
   	at org.apache.flink.streaming.runtime.tasks.StreamTask.afterInvoke(StreamTask.java:724)
   	at org.apache.flink.streaming.runtime.tasks.StreamTask.executeInvoke(StreamTask.java:645)
   	at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:650)
   	at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:623)
   	at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:779)
   	at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve][hbase] The specified column is written to the specified column family [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#discussion_r1644161527


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/sink/HbaseSinkWriter.java:
##########
@@ -128,8 +129,13 @@ private Put convertRowToPut(SeaTunnelRow row) {
                         .collect(Collectors.toList());
         for (Integer writeColumnIndex : writeColumnIndexes) {
             String fieldName = seaTunnelRowType.getFieldName(writeColumnIndex);
-            String familyName =
-                    hbaseParameters.getFamilyNames().getOrDefault(fieldName, defaultFamilyName);
+            // This is the family of columns that we define to be written through the.conf file
+            Map<String, String> configurationFamilyNames = hbaseParameters.getFamilyNames();
+            String familyName = configurationFamilyNames.getOrDefault(fieldName, defaultFamilyName);
+            if (!configurationFamilyNames.containsKey(ALL_COLUMNS)

Review Comment:
   The key point is the default column family `value` maybe not existed in hbase. So we should only put value into hbase which be configured in `family_name`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve][hbase] The specified column is written to the specified column family [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#issuecomment-2175667456

   How about remove the `defaultFamilyName` field? I think it useless.
   https://github.com/apache/seatunnel/pull/5234/files#diff-8f30c3a97d2812a845e154ecff09fbaeeb7ef4caeb43d47d17f101d787d202b7R66
   
    cc @TyrantLucifer 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve][hbase] The specified column is written to the specified column family [seatunnel]

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 merged PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] zhilinli123 commented on a diff in pull request #5234: [Improve][hbase] The specified column is written to the specified column family

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#discussion_r1288664418


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/sink/HbaseSinkWriter.java:
##########
@@ -128,8 +129,13 @@ private Put convertRowToPut(SeaTunnelRow row) {
                         .collect(Collectors.toList());
         for (Integer writeColumnIndex : writeColumnIndexes) {
             String fieldName = seaTunnelRowType.getFieldName(writeColumnIndex);
-            String familyName =
-                    hbaseParameters.getFamilyNames().getOrDefault(fieldName, defaultFamilyName);
+            // This is the family of columns that we define to be written through the.conf file
+            Map<String, String> configurationFamilyNames = hbaseParameters.getFamilyNames();
+            String familyName = configurationFamilyNames.getOrDefault(fieldName, defaultFamilyName);
+            if (!configurationFamilyNames.containsKey(ALL_COLUMNS)

Review Comment:
   @TyrantLucifer Now there are some problems with specifying columns to write column families
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] Hisoka-X commented on a diff in pull request #5234: [Improve][hbase] The specified column is written to the specified column family

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#discussion_r1306396869


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/sink/HbaseSinkWriter.java:
##########
@@ -128,8 +129,13 @@ private Put convertRowToPut(SeaTunnelRow row) {
                         .collect(Collectors.toList());
         for (Integer writeColumnIndex : writeColumnIndexes) {
             String fieldName = seaTunnelRowType.getFieldName(writeColumnIndex);
-            String familyName =
-                    hbaseParameters.getFamilyNames().getOrDefault(fieldName, defaultFamilyName);
+            // This is the family of columns that we define to be written through the.conf file
+            Map<String, String> configurationFamilyNames = hbaseParameters.getFamilyNames();
+            String familyName = configurationFamilyNames.getOrDefault(fieldName, defaultFamilyName);
+            if (!configurationFamilyNames.containsKey(ALL_COLUMNS)

Review Comment:
   Maybe you should add test case for this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] TyrantLucifer commented on a diff in pull request #5234: [Improve][hbase] The specified column is written to the specified column family

Posted by "TyrantLucifer (via GitHub)" <gi...@apache.org>.
TyrantLucifer commented on code in PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#discussion_r1288411807


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/sink/HbaseSinkWriter.java:
##########
@@ -128,8 +129,13 @@ private Put convertRowToPut(SeaTunnelRow row) {
                         .collect(Collectors.toList());
         for (Integer writeColumnIndex : writeColumnIndexes) {
             String fieldName = seaTunnelRowType.getFieldName(writeColumnIndex);
-            String familyName =
-                    hbaseParameters.getFamilyNames().getOrDefault(fieldName, defaultFamilyName);
+            // This is the family of columns that we define to be written through the.conf file
+            Map<String, String> configurationFamilyNames = hbaseParameters.getFamilyNames();
+            String familyName = configurationFamilyNames.getOrDefault(fieldName, defaultFamilyName);
+            if (!configurationFamilyNames.containsKey(ALL_COLUMNS)

Review Comment:
   I have one question: Why you change the logic of this and what's the meaning of this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] zhilinli123 commented on pull request #5234: [Improve][hbase] The specified column is written to the specified column family

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on PR #5234:
URL: https://github.com/apache/seatunnel/pull/5234#issuecomment-1667288896

   ```
   env {
     execution.parallelism = 1
     job.mode = "BATCH"
   }
   source {
     FakeSource {
       row.num = 5
       schema {
         fields {
           name = string
           sex = string
           id = int
           c_tinyint = tinyint
           c_smallint = smallint
           c_bigint = bigint
           c_float = float
           c_double = double
           c_boolean = boolean
         }
       }
     }
   }
   
   sink {
     Hbase {
       zookeeper_quorum = "127.0.0.1:2181"
       table = "mytable"
       rowkey_column = ["id"]
       family_name {
         sex = "cf1"
         c_double="cf2"
       }
     }
   }
   ```
   ### 1.test result
   ```
   hbase:019:0> scan 'mytable'
   ROW                                          COLUMN+CELL                                                                                                                       
    1759466695                                  column=cf1:sex, timestamp=2023-08-07T14:31:25.156, value=NznyY                                                                    
    1759466695                                  column=cf2:c_double, timestamp=2023-08-07T14:31:25.156, value=\x7Fy\xC6}\x99\xAE\xDD\x7F                                          
    1780672007                                  column=cf1:sex, timestamp=2023-08-07T14:31:25.156, value=AWaOp                                                                    
    1780672007                                  column=cf2:c_double, timestamp=2023-08-07T14:31:25.156, value=\x7F\xD1\x96\xF9'\xF2\xAB\xC7                                       
    2055845044                                  column=cf1:sex, timestamp=2023-08-07T14:31:25.157, value=WbONr                                                                    
    2055845044                                  column=cf2:c_double, timestamp=2023-08-07T14:31:25.157, value=\x7F\xEF\xB8Qq\x96\xCD\xBF                                          
    846088245                                   column=cf1:sex, timestamp=2023-08-07T14:31:25.157, value=HcEQx                                                                    
    846088245                                   column=cf2:c_double, timestamp=2023-08-07T14:31:25.157, value=\x7F\xDE\x18E\x80vX\x1F                                             
    870654670                                   column=cf1:sex, timestamp=2023-08-07T14:31:25.139, value=XxnBp                                                                    
    870654670                                   column=cf2:c_double, timestamp=2023-08-07T14:31:25.139, value=\x7F\xED\xB0;|\xE9\x95V                                             
   5 row(s)
   Took 0.0119 seconds                                                                                                                                                            
   ```
   ```
   env {
     execution.parallelism = 1
     job.mode = "BATCH"
   }
   source {
     FakeSource {
       row.num = 5
       schema {
         fields {
           name = string
           sex = string
           id = int
           c_tinyint = tinyint
           c_smallint = smallint
           c_bigint = bigint
           c_float = float
           c_double = double
           c_boolean = boolean
         }
       }
     }
   }
   
   sink {
     Hbase {
       zookeeper_quorum = "127.0.0.1:2181"
       table = "mytable"
       rowkey_column = ["id"]
       family_name {
         all_columns = "cf1"
       }
     }
   }
   
   
   ```
   ### 2.test result
   
   ```
   hbase:012:0> scan 'mytable'
   ROW                                          COLUMN+CELL                                                                                                                       
    1090653725                                  column=cf1:c_bigint, timestamp=2023-08-07T14:30:15.369, value=N\x0E\xB3\xC0\xE5\x95h\x00                                          
    1090653725                                  column=cf1:c_boolean, timestamp=2023-08-07T14:30:15.369, value=\xFF                                                               
    1090653725                                  column=cf1:c_double, timestamp=2023-08-07T14:30:15.369, value=\x7F\xE5&8\x978\x1D&                                                
    1090653725                                  column=cf1:c_float, timestamp=2023-08-07T14:30:15.369, value=|\xBFB\xBF                                                           
    1090653725                                  column=cf1:c_smallint, timestamp=2023-08-07T14:30:15.369, value=\x03\x88                                                          
    1090653725                                  column=cf1:c_tinyint, timestamp=2023-08-07T14:30:15.369, value=\x00x                                                              
    1090653725                                  column=cf1:name, timestamp=2023-08-07T14:30:15.369, value=dtoZn                                                                   
    1090653725                                  column=cf1:sex, timestamp=2023-08-07T14:30:15.369, value=BhBCy                                                                    
    1598995474                                  column=cf1:c_bigint, timestamp=2023-08-07T14:30:15.348, value=J\xE5[d\x8A\xB1\xF0\x00                                             
    1598995474                                  column=cf1:c_boolean, timestamp=2023-08-07T14:30:15.348, value=\x00                                                               
    1598995474                                  column=cf1:c_double, timestamp=2023-08-07T14:30:15.348, value=\x7F\xCC\xC7\x00\xC3\x1F\x9BW                                       
    1598995474                                  column=cf1:c_float, timestamp=2023-08-07T14:30:15.348, value=~1\x0A{                                                              
    1598995474                                  column=cf1:c_smallint, timestamp=2023-08-07T14:30:15.348, value=s\xA7                                                             
    1598995474                                  column=cf1:c_tinyint, timestamp=2023-08-07T14:30:15.348, value=\x00V                                                              
    1598995474                                  column=cf1:name, timestamp=2023-08-07T14:30:15.348, value=emHjZ                                                                   
    1598995474                                  column=cf1:sex, timestamp=2023-08-07T14:30:15.348, value=ZDxhr                                                                    
    1711134621                                  column=cf1:c_bigint, timestamp=2023-08-07T14:30:15.370, value=\x15\xAC\xC3)\xB2\xA9`\x00                                          
    1711134621                                  column=cf1:c_boolean, timestamp=2023-08-07T14:30:15.370, value=\x00                                                               
    1711134621                                  column=cf1:c_double, timestamp=2023-08-07T14:30:15.370, value=\x7F\xEF\xDB\x82P\x1B\xB9f                                          
    1711134621                                  column=cf1:c_float, timestamp=2023-08-07T14:30:15.370, value=\x7F\x5C\x08P                                                        
    1711134621                                  column=cf1:c_smallint, timestamp=2023-08-07T14:30:15.370, value==\xE4                                                             
    1711134621                                  column=cf1:c_tinyint, timestamp=2023-08-07T14:30:15.370, value=\x00m                                                              
    1711134621                                  column=cf1:name, timestamp=2023-08-07T14:30:15.370, value=IqIlw                                                                   
    1711134621                                  column=cf1:sex, timestamp=2023-08-07T14:30:15.370, value=ZRhVp                                                                    
    292694142                                   column=cf1:c_bigint, timestamp=2023-08-07T14:30:15.370, value=IEq\xC7@\xBE\xB8\x00                                                
    292694142                                   column=cf1:c_boolean, timestamp=2023-08-07T14:30:15.370, value=\x00                                                               
    292694142                                   column=cf1:c_double, timestamp=2023-08-07T14:30:15.370, value=\x7F\xEE\xE1\x9C\xFF\x9C\xBF!                                       
    292694142                                   column=cf1:c_float, timestamp=2023-08-07T14:30:15.370, value=~\xE9\xBDK                                                           
    292694142                                   column=cf1:c_smallint, timestamp=2023-08-07T14:30:15.370, value=\x05\xB0                                                          
    292694142                                   column=cf1:c_tinyint, timestamp=2023-08-07T14:30:15.370, value=\x00X                                                              
    292694142                                   column=cf1:name, timestamp=2023-08-07T14:30:15.370, value=ADZBA                                                                   
    292694142                                   column=cf1:sex, timestamp=2023-08-07T14:30:15.370, value=HZNdM                                                                    
    935487355                                   column=cf1:c_bigint, timestamp=2023-08-07T14:30:15.370, value=,v\xCFqL8 \x00                                                      
    935487355                                   column=cf1:c_boolean, timestamp=2023-08-07T14:30:15.370, value=\x00                                                               
    935487355                                   column=cf1:c_double, timestamp=2023-08-07T14:30:15.370, value=\x7F\xDA\xC6J\xB8\xA8^\x15                                          
    935487355                                   column=cf1:c_float, timestamp=2023-08-07T14:30:15.370, value=~\xDAC\xA5                                                           
    935487355                                   column=cf1:c_smallint, timestamp=2023-08-07T14:30:15.370, value=C7                                                                
    935487355                                   column=cf1:c_tinyint, timestamp=2023-08-07T14:30:15.370, value=\x00#                                                              
    935487355                                   column=cf1:name, timestamp=2023-08-07T14:30:15.370, value=OaKTk                                                                   
    935487355                                   column=cf1:sex, timestamp=2023-08-07T14:30:15.370, value=PoozR                                                                    
   5 row(s)
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org