Hi Zakaria,

There's a lot going on in that error message.  I've got a suggestion, but
first a question:

Where is the line which contains 'Bad indirect slice' come from?  Are you
perhaps catching an exception returned by createTable and printing the
error?  If so, this could explain the subsequent 'The table does not exist'
failure when you attempt to read or write to the table.

It looks like in your code snippet you are creating the schema twice.  It's
recommended that you create the schema once and re-use it wherever needed
while creating the table.  If you create more than one schema object and
set different options (or columns) you may hit issues, we currently aren't
as robust in this regard as we should be (see KUDU-1179 and KUDU-2133).

- Dan

On Fri, Feb 9, 2018 at 12:01 AM, Zakaria Afkir <zaf...@talend.com> wrote:

>
>
>
>
> *De :* Zakaria Afkir
> *Envoyé :* vendredi 9 février 2018 08:59
> *À :* 'iss...@kudu.apache.org' <iss...@kudu.apache.org>
> *Objet :* Cannot create Kudu table with Range Partitioning
>
>
>
> Hello,
>
> I'm using Kudu-spark2_2.11-1.4.0-cdh5.12.1.jar and I get an error when
> creating a table with range partitioning and the table doesn't exist.
>
> The code to create Kudu table with range partitioning:
>
> java.util.ArrayList<org.apache.kudu.ColumnSchema> columns = new
> java.util.ArrayList<>();
>
> columns.add(new org.apache.kudu.ColumnSchema.ColumnSchemaBuilder("name",
> org.apache.kudu.Type.STRING).nullable(false).key(true).build());
>
> org.apache.kudu.Schema schema = new org.apache.kudu.Schema(columns);
>
> org.apache.kudu.client.PartialRow lower = schema.newPartialRow();
>
> lower.addString("name", "a");
>
>
>
> columns = new java.util.ArrayList<>();
>
> columns.add(new org.apache.kudu.ColumnSchema.ColumnSchemaBuilder("name",
> org.apache.kudu.Type.STRING).nullable(false).key(true).build());
>
> schema = new org.apache.kudu.Schema(columns);
>
> org.apache.kudu.client.PartialRow upper = schema.newPartialRow();
>
> upper.addString("name", "z");
>
> kuduCtx_tKuduOutput_1.createTable("table2", types_row1, keys_row1, new
> org.apache.kudu.client.CreateTableOptions()
>
> .addHashPartitions(java.util.Arrays.asList("name"), 2)
>
> .addRangePartition(lower, upper)
>
> .setRangePartitionColumns(java.util.Arrays.asList("name"))
>
> .setNumReplicas(1));
>
>
>
> And the error:
>
>
>
> [ERROR]: local_project.sparkwithtkuduoutput_0_1.SparkWithtKuduOutput - 
> tKuduOutput_1 - Bad indirect slice
>
> org.apache.kudu.client.NonRecoverableException: The table does not exist: 
> table_name: "table2"
>
> at 
> org.apache.kudu.client.TabletClient.dispatchMasterErrorOrReturnException(TabletClient.java:557)
>
> at org.apache.kudu.client.TabletClient.messageReceived(TabletClient.java:467)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>
> at org.apache.kudu.client.TabletClient.handleUpstream(TabletClient.java:603)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.timeout.ReadTimeoutHandler.messageReceived(ReadTimeoutHandler.java:184)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
>
> at 
> org.apache.kudu.client.shaded.org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
>
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> at java.lang.Thread.run(Unknown Source)
>
>
> Thanks,
>
> Best regards
>

Reply via email to