<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: loading hbase table in pyspark throws &amp;quot;Expecting at least one region for table &amp;quot; error, while the table has regions in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/loading-hbase-table-in-pyspark-throws-quot-Expecting-at/m-p/334625#M231835</link>
    <description>&lt;P&gt;&lt;SPAN&gt;For future reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am on a hbase cluster, and also need access to the hive metastore. It seems that in case the hive-site.xml contains some wrong values, you can have this behavior.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 09:11:34 GMT</pubDate>
    <dc:creator>JB0000000000001</dc:creator>
    <dc:date>2022-01-27T09:11:34Z</dc:date>
    <item>
      <title>loading hbase table in pyspark throws "Expecting at least one region for table " error, while the table has regions</title>
      <link>https://community.cloudera.com/t5/Support-Questions/loading-hbase-table-in-pyspark-throws-quot-Expecting-at/m-p/322416#M228775</link>
      <description>&lt;P&gt;Dear experts,&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;I notice when I try to load a hbase data in pyspark, it tells me&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;java.io.IOException: Expecting at least one region for table : myhbasetable at org.apache.hadoop.hbase.mapreduce.MultiTableInputFormatBase.getSplits(MultiTableInputFormatBase.java:195) at org.locationtech.geomesa.hbase.jobs.GeoMesaHBaseInputFormat.getSplits(GeoMesaHBaseInputFormat.scala:43) at org.apache.spark.rdd.NewHadoopRDD.getPartitions(NewHadoopRDD.scala:130)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It looks like it is telling me the table has to at least have some data in at least 1 region.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the relevant piece of code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/apache/hbase/blob/master/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.java" target="_blank"&gt;https://github.com/apache/hbase/blob/master/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatBase.java&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;try (Connection conn = ConnectionFactory.createConnection(context.getConfiguration())) {
      while (iter.hasNext()) {
        Map.Entry&amp;lt;TableName, List&amp;lt;Scan&amp;gt;&amp;gt; entry = (Map.Entry&amp;lt;TableName, List&amp;lt;Scan&amp;gt;&amp;gt;) iter.next();
        TableName tableName = entry.getKey();
        List&amp;lt;Scan&amp;gt; scanList = entry.getValue();
        try (Table table = conn.getTable(tableName);
             RegionLocator regionLocator = conn.getRegionLocator(tableName)) {
          RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(
              regionLocator, conn.getAdmin());
          Pair&amp;lt;byte[][], byte[][]&amp;gt; keys = regionLocator.getStartEndKeys();
          for (Scan scan : scanList) {
            if (keys == null || keys.getFirst() == null || keys.getFirst().length == 0) {
              throw new IOException("Expecting at least one region for table : "
                  + tableName.getNameAsString());
            }&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;can see in the hbase master, that his table has data spread out over 4 regions.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;And in hbase shell, I can scan the data with no error. This is on hbase 2.1. It seems he is not finding the fact there are regions for this table. I wonder what could cause this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Did anyone every encounter this error?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 14:25:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/loading-hbase-table-in-pyspark-throws-quot-Expecting-at/m-p/322416#M228775</guid>
      <dc:creator>JB0000000000001</dc:creator>
      <dc:date>2021-08-11T14:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: loading hbase table in pyspark throws "Expecting at least one region for table " error, while the table has regions</title>
      <link>https://community.cloudera.com/t5/Support-Questions/loading-hbase-table-in-pyspark-throws-quot-Expecting-at/m-p/334625#M231835</link>
      <description>&lt;P&gt;&lt;SPAN&gt;For future reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am on a hbase cluster, and also need access to the hive metastore. It seems that in case the hive-site.xml contains some wrong values, you can have this behavior.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 09:11:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/loading-hbase-table-in-pyspark-throws-quot-Expecting-at/m-p/334625#M231835</guid>
      <dc:creator>JB0000000000001</dc:creator>
      <dc:date>2022-01-27T09:11:34Z</dc:date>
    </item>
  </channel>
</rss>

