diff --git a/src/main/java/com/alipay/oceanbase/hbase/OHTable.java b/src/main/java/com/alipay/oceanbase/hbase/OHTable.java index 106058eb..d0463ab5 100644 --- a/src/main/java/com/alipay/oceanbase/hbase/OHTable.java +++ b/src/main/java/com/alipay/oceanbase/hbase/OHTable.java @@ -927,6 +927,9 @@ private void processColumnFilters(NavigableSet columnFilters, @Override public Result get(final Get get) throws IOException { if (get.getFamilyMap().keySet().isEmpty()) { + if (!FeatureSupport.isEmptyFamilySupported()) { + throw new FeatureNotSupportedException("empty family get not supported yet within observer version: " + ObGlobal.obVsnString()); + } // check nothing, use table group; } else { checkFamilyViolation(get.getFamilyMap().keySet(), false); @@ -1012,6 +1015,9 @@ public Result[] get(List gets) throws IOException { @Override public ResultScanner getScanner(final Scan scan) throws IOException { if (scan.getFamilyMap().keySet().isEmpty()) { + if (!FeatureSupport.isEmptyFamilySupported()) { + throw new FeatureNotSupportedException("empty family scan not supported yet within observer version: " + ObGlobal.obVsnString()); + } // check nothing, use table group; } else { checkFamilyViolation(scan.getFamilyMap().keySet(), false); diff --git a/src/main/java/com/alipay/oceanbase/hbase/util/FeatureSupport.java b/src/main/java/com/alipay/oceanbase/hbase/util/FeatureSupport.java new file mode 100644 index 00000000..9054b10e --- /dev/null +++ b/src/main/java/com/alipay/oceanbase/hbase/util/FeatureSupport.java @@ -0,0 +1,14 @@ +package com.alipay.oceanbase.hbase.util; + +import static com.alipay.oceanbase.rpc.ObGlobal.OB_VERSION; +import static com.alipay.oceanbase.rpc.ObGlobal.calcVersion; + + +public class FeatureSupport { + // check empty family get/scan supported + public static boolean isEmptyFamilySupported() { + return (OB_VERSION >= calcVersion(4, 2, 3, 0) + && OB_VERSION < calcVersion(4, 3, 0, 0)) + || (OB_VERSION > calcVersion(4, 3, 4, 0)); + } +}