Git Product home page Git Product logo

hdinsight-phoenix-sharp's Introduction

Microsoft .NET driver for Apache Phoenix Query Server

This is C# client library for Phoenix Query Server on Azure HDInsight. It currently targets HBase 1.1.2, Phoenix 4.4.0 and HDInsight 3.4 and later versions on Microsoft Azure. The communication works through Avatica APIs which uses Protocol Buffers as a serialization format.

Getting Started

  • Avatica Protocol Buffers Reference - Although Phoenix query server supports both Protocol Buffers and JSON to serialize its requests, this driver will only support Protocol Buffers. This page demonstrates all the Avatica APIs for reference.
  • Getting Started with Linux HBase Clusters - Phoenix query server along with Phoenix will be available in HDInsight Linux-based HBase clusters. This documentation article walks you through the steps to create Linux HBase clusters on Azure.

Build

Import the solution file into VS2013 and compile. Retrieve the resulting *.dll files.

Here is the nuget package

NOTE: 2.0.0 will not work on HDI 3.4. HDI 3.5 includes Avatica 1.8.0 and Phoenix 4.7 which include some breaking changes. CALCITE-1458 will fix the incompatibility and 1.2.0 will work in the hotfixed release. However, since those APIs will eventually deprecate. 2.0.0 will not support those deprecate APIs.

More examples about how to use the SDK will be published on Azure websites soon.

Usage

  • hdinsight-phoenix-sharp/PhoenixSharp.UnitTests/PhoenixClientTests.cs would be a good example to learn how to use the APIs.

  • Twitter streaming example - I recently updated the twitter streaming example from HDInsight tutorial with the PQS .NET APIs. Please check it out.

hdinsight-phoenix-sharp's People

Contributors

duoxu avatar gkanade avatar microsoft-github-policy-service[bot] avatar tsrinivasr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hdinsight-phoenix-sharp's Issues

I get this error when I try to build

PhoenixSharp\PhoenixClient.cs(64,38): Error CS1061: 'PrepareAndExecuteRequest' does not contain a definition for 'ToByteString' and no extension method 'ToByteString' accepting a first argument of type 'PrepareAndExecuteRequest' could be found (are you missing a using directive or an assembly reference?)

VNetTests.cs unit testing is failing with Hortonworks Data Platform (2.3 & 2.4) Linux VM

First of all, thanks for your effort.
I'm able to connect Azure PQS from the unit testing code and it is working fine.
I would like to use, VNetTests.cs unit testing code by connecting my local HDP ( Hortonworks Data Platform version 2.3 and 2.4) virtualbox images, but both the versions are failed with 404 error.
In both the versions(2.3 & 2.4), I've installed and configured Phoenix Query Server and I'm able to connect them via sqlline.py(JDBC) and it is working fine.
When I tried from .net based unit testing, I'm getting 404 error.
Can you please let me know, do I need to do any additional setup in the HDP to query it from .net application?

Thanks in advance.

PrepareRequest "Parameter Unbound" Error (Join Only Takes Params from One Table)

When we try to use parameters in a more-complicated query (we think specifically when we use joins), our code fails at PrepareRequestAsync(), returning an exception that a parameter is unbound- which to us seems very strange, since we don't want to bind any parameters until we're going to call ExecuteRequestAsync().
We assume that we are doing something wrong in our code, but if that is not the case, we suspect this is a problem in Phoenix or even Calcite. We found this (identical?) problem on the Hortonworks Community forum, unresolved: https://community.hortonworks.com/questions/45896/problem-executing-joins-on-phoenix-query-server.html. It links to [CALCITE-1052]- I can't tell if this is really related- at the very least, the connectionId in our error message matches the connectionId of our PrepareRequest, which it sounds like wasn't true for them. Regardless, their issue was apparently solved by updating to Phoenix 4.7, and I believe we are running 4.4, so if someone with a newer version can confirm that this isn't reproducible in 4.7, I'll make the requests to get our install updated to that.

Table Setup:

DROP TABLE IF EXISTS ShippingCodeFact;
CREATE TABLE IF NOT EXISTS ShippingCodeFact (
CodeId DECIMAL (18, 0),
StringData VARCHAR,
CodeKey BIGINT NOT NULL,
CustomerId VARCHAR,
StartDate TIMESTAMP,
EndDate TIMESTAMP,
CONSTRAINT my_pk PRIMARY KEY(CodeId, StringData, CodeKey)
) SALT_BUCKETS=32, COMPRESSION='GZ';
DROP TABLE IF EXISTS ShippingGlobalCodes;
CREATE TABLE IF NOT EXISTS ShippingGlobalCodes (
GlobalCode VARCHAR,
InternalCode VARCHAR,
CodeName VARCHAR,
CodeKey BIGINT NOT NULL
CONSTRAINT my_pk PRIMARY KEY(GlobalCode, InternalCode, CodeKey)
) SALT_BUCKETS=32;

Code:

var client = new PhoenixClient(null);
var random = new Random();
string connId = "0123456789abcdef";
connId = new string(Enumerable.Repeat(connId, 8).Select(s => s[random.Next(s.Length)]).ToArray());

RequestOptions options = RequestOptions.GetVNetDefaultOptions();
options.AlternativeHost = HOST_SERVER;

OpenConnectionResponse openConnResponse = null;

try
{
    Google.Protobuf.Collections.MapField<string, string> info = new Google.Protobuf.Collections.MapField<string, string>();
    openConnResponse = client.OpenConnectionRequestAsync(connId, info, options).Result;

    ConnectionProperties connProperties = new ConnectionProperties
    {
        HasAutoCommit = true,
        AutoCommit = false,
        HasReadOnly = true,
        ReadOnly = false,
        TransactionIsolation = 0,
        Catalog = "",
        Schema = "",
        IsDirty = true
    };
    client.ConnectionSyncRequestAsync(connId, connProperties, options).Wait();

    string cmdText = "SELECT fact0.CustomerId FROM ShippingCodeFact fact0 INNER JOIN ShippingGlobalCodes gcD1 ON fact0.StringData = gcD1.InternalCode WHERE fact0.StartDate < ? AND fact0.EndDate >= ? AND gcD1.GlobalCode = ?";

    var paramList = new Google.Protobuf.Collections.RepeatedField<TypedValue>();
    TypedValue v1 = new TypedValue
    {
        NumberValue = ((new DateTime(2016, 7, 26)).Ticks - (new DateTime(1970, 1, 1)).Ticks)/10000,
        Type = Rep.JAVA_SQL_TIMESTAMP
    };
    TypedValue v2 = new TypedValue
    {
        NumberValue = ((new DateTime(2016, 4, 26)).Ticks - (new DateTime(1970, 1, 1)).Ticks)/10000,
        Type = Rep.JAVA_SQL_TIMESTAMP
    };
    TypedValue v3 = new TypedValue
    {
        StringValue = "87603000",
        Type = Rep.STRING
    };
    paramList.Add(v1);
    paramList.Add(v2);
    paramList.Add(v3);

    PrepareResponse prepareResponse = client.PrepareRequestAsync(connId, cmdText, ulong.MaxValue, options).Result;
    StatementHandle statementHandle = prepareResponse.Statement;
    ExecuteResponse execResponse = client.ExecuteRequestAsync(statementHandle, paramList, ulong.MaxValue, true, options).Result;
    FetchResponse fetchResponse = null;
    if(!execResponse.Results[0].FirstFrame.Done)
        fetchResponse = client.FetchRequestAsync(connId, prepareResponse.Statement.Id, 0, uint.MaxValue, options).Result;
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}
finally
{
    if (openConnResponse != null)
    {
        client.CloseConnectionRequestAsync(connId, options).Wait();
        openConnResponse = null;
    }
}

Exception "errorMessage":

RuntimeException: java.sql.SQLException: ERROR 2004 (INT05): Parameter value unbound Parameter at index 3 is unbound -\u003e SQLException: ERROR 2004 (INT05): Parameter value unbound Parameter at index 3 is unbound

(If anyone wants I can paste the whole "exceptions" value- most of it is just the trace)

@duoxu since you've seemed interested in the other issues

Prepare then Execute Missing Results (No Mapping to Phoenix DECIMAL)

Please let me know if there's somewhere else this should go.

PrepareAndExecute works just fine for me; I can get my desired output (insecurely) like this:

ExecuteResponse execResponse = client.PrepareAndExecuteRequestAsync(connId, cmdTextPAE, ulong.MaxValue, createStatementResponse.StatementId, options).Result;
foreach (var res in execResponse.Results[0].FirstFrame.Rows)
    Console.WriteLine(res.Value[0].Value[0].StringValue + " | " + res.Value[1].Value[0].NumberValue);

but when I use Prepare and then Execute like so:

PrepareResponse prepareResponse = client.PrepareRequestAsync(connId, cmdTextPTE, ulong.MaxValue, options).Result;
StatementHandle statementHandle = prepareResponse.Statement;    
ExecuteResponse executeResponse = client.ExecuteRequestAsync(statementHandle, paramList, ulong.MaxValue, true, options).Result;
Console.WriteLine(executeResponse.Results[0].FirstFrame);
FetchResponse fetchResponse = client.FetchRequestAsync(connId, createStatementResponse.StatementId, 0, uint.MaxValue, options).Result;
Console.WriteLine(fetchResponse);

the output is

{ "done": true }
{ "missingResults": true, "metadata": { "serverAddress": "hostserver:8765" } }

(and from further investigation I can say the other information in the executeResponse all looks correct, but none of it is actually the result set)

Just by looking at the unit tests I can't see that I'm using anything wrong, but obviously that's the less-likely possibility. If I really am not though, then there seems to be a problem with the Prepare-then-Execute system, as it's missing a result set that PrepareAndExecute is finding just fine.

PhoenixSharp.Interface is not compiling

PhoenixSharp.Interfaces project is not compiling for me. I'm using Visual Studio 2013 premium with update 5.
I update the nuget package references correctly, but PostRequestAction?.Invoke(this); line of coding giving compilation issue.

Error   4   Invalid expression term '.' C:\Development\Github\hdinsight-phoenix-sharp\PhoenixSharp.Interfaces\IWebRequester.cs  36  31  PhoenixSharp.Interfaces 
Error   5   Syntax error, ':' expected  C:\Development\Github\hdinsight-phoenix-sharp\PhoenixSharp.Interfaces\IWebRequester.cs  36  32  PhoenixSharp.Interfaces
Error   6   Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement   C:\Development\Github\hdinsight-phoenix-sharp\PhoenixSharp.Interfaces\IWebRequester.cs  36  13  PhoenixSharp.Interfaces
Error   7   The name 'Invoke' does not exist in the current context C:\Development\Github\hdinsight-phoenix-sharp\PhoenixSharp.Interfaces\IWebRequester.cs  36  32  PhoenixSharp.Interfaces

Attached screenshot for your references.

phoenixsharp interface-compilation-issue

NullReferenceException from Phoenix.Interfaces.Response.Dispose()

My situation is that one of my region servers is down but my PQS is up. I'm using VNET mode. I can successfully connect via the OpenConnectionRequestAsync call followed by successful ConnectionSyncRequestAsync and CreateStatementRequestAsync calls. But when I then execute a PrepareAndExecuteRequestAsync, I get a NullReferenceException.

Here is my stack trace:

   at PhoenixSharp.Interfaces.Response.Dispose()
   at PhoenixSharp.PhoenixClient.<PrepareAndExecuteRequestAsync>d__2.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Garuda.Data.PhoenixConnection.<InternalExecuteRequestAsync>d__46.MoveNext() in C:\Code\DotNet\GarudaUtil\Garuda.Data\PhoenixConnection.cs:line 317

The issue appears to be an unchecked forwarding of the Dispose to the WebResponse in the Phoenix.Interfaces.Response class's Dispose method.

In my case the VnetWebRequester is getting a "operation timed out" WebException, and the WebResponse object passed into the Phoenix.Interfaces.Response.WebResponse property is null (in the WebException catch block).

This appears to result in a null reference exception from the following line of PhoenixClient::PrepareAndExecuteBatchRequestAsync:

if (webResponse.WebResponse.StatusCode != HttpStatusCode.OK)

Which then throws through the using statement causing the Dispose related NullReferenceException.

        public void Dispose()
        {
            if (PostRequestAction != null)
            {
                PostRequestAction(this);
            }
            WebResponse.Dispose(); // <-- 
        }

The if (webResponse.WebResponse.StatusCode != HttpStatusCode.OK) line is listed in many of the PhoenixClient methods, so this issue looks like it could appear in one form or another for other calls with a timeout related response.

Exception while fetching column with data type as ARRAY (like COL1 INT[] / COL2 STRING[])

Getting bellow error while trying to fetch data from column with type as ARRAY. Is anything extra need to be done for getting Array type value from table using Phoenix for HBase Azure cluster?

ERROR INFO:

"Message : System.AggregateException: One or more errors occurred. ---> System.Net.WebException: PrepareAndExecuteRequestAsync failed! connectionId: ac6a8eba, 
Response code was: **InternalServerError**, 
Response body was: { "exceptions": [ "java.lang.UnsupportedOperationException: Currently not supported
      org.apache.phoenix.schema.types.PhoenixArray.getResultSet(PhoenixArray.java:188)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.getValue(JdbcResultSet.java:189)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.frame(JdbcResultSet.java:142)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:91)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:71)
      org.apache.calcite.avatica.jdbc.JdbcMeta.prepareAndExecute(JdbcMeta.java:703)
      org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:187)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1064)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1038)
      org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:102)
      org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38)
      org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68)
      org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      org.eclipse.jetty.server.Server.handle(Server.java:499)
      org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      java.lang.Thread.run(Thread.java:745)
" ], 
"errorMessage": "UnsupportedOperationException: Currently not supported", 
"errorCode": 4294967295, 
"sqlState": "00000", 
"metadata": { "serverAddress": "wn11-hbases:8765" }, 
"hasExceptions": true }
   at PhoenixSharp.PhoenixClient.<PrepareAndExecuteRequestAsync>d__2.MoveNext() in \hdinsight-phoenix-sharp-master\hdinsight-phoenix-sharp-master\PhoenixSharp\PhoenixClient.cs:line 74
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at PhoenixSharp.UnitTests.PhoenixClientTests.ConnectAndExecuteWrapper(String sqlQuery, 
StatementType selectType, 
IEnumerable`1 listValues) in \hdinsight-phoenix-sharp-master\hdinsight-phoenix-sharp-master\PhoenixSharp.UnitTests\PhoenixClientTests.cs:line 478
---> (Inner Exception #0) System.Net.WebException: PrepareAndExecuteRequestAsync failed! connectionId: ac6a8eba, 
Response code was: InternalServerError, 
Response body was: { "exceptions": [ "java.lang.UnsupportedOperationException: Currently not supported
      org.apache.phoenix.schema.types.PhoenixArray.getResultSet(PhoenixArray.java:188)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.getValue(JdbcResultSet.java:189)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.frame(JdbcResultSet.java:142)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:91)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:71)
      org.apache.calcite.avatica.jdbc.JdbcMeta.prepareAndExecute(JdbcMeta.java:703)
      org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:187)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1064)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1038)
      org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:102)
      org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38)
      org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68)
      org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      org.eclipse.jetty.server.Server.handle(Server.java:499)
      org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      java.lang.Thread.run(Thread.java:745)
" ], 
"errorMessage": "UnsupportedOperationException: Currently not supported", 
"errorCode": 4294967295, 
"sqlState": "00000", 
"metadata": { "serverAddress": "wn11-hbases:8765" }, 
"hasExceptions": true }
   at PhoenixSharp.PhoenixClient.<PrepareAndExecuteRequestAsync>d__2.MoveNext() in \hdinsight-phoenix-sharp-master\hdinsight-phoenix-sharp-master\PhoenixSharp\PhoenixClient.cs:line 74<---

Stack Trace :    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at PhoenixSharp.UnitTests.PhoenixClientTests.ConnectAndExecuteWrapper(String sqlQuery, 
StatementType selectType, 
IEnumerable`1 listValues) in \hdinsight-phoenix-sharp-master\PhoenixSharp.UnitTests\PhoenixClientTests.cs:line 478

Message : System.Net.WebException: PrepareAndExecuteRequestAsync failed! connectionId: ac6a8eba, 
Response code was: InternalServerError, 
Response body was: { "exceptions": [ "java.lang.UnsupportedOperationException: Currently not supported
      org.apache.phoenix.schema.types.PhoenixArray.getResultSet(PhoenixArray.java:188)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.getValue(JdbcResultSet.java:189)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.frame(JdbcResultSet.java:142)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:91)
      org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:71)
      org.apache.calcite.avatica.jdbc.JdbcMeta.prepareAndExecute(JdbcMeta.java:703)
      org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:187)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1064)
      org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1038)
      org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:102)
      org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38)
      org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68)
      org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      org.eclipse.jetty.server.Server.handle(Server.java:499)
      org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      java.lang.Thread.run(Thread.java:745)
" ], 
"errorMessage": "UnsupportedOperationException: Currently not supported", 
"errorCode": 4294967295, 
"sqlState": "00000", 
"metadata": { "serverAddress": "wn11-hbases:8765" }, 
"hasExceptions": true }
   at PhoenixSharp.PhoenixClient.<PrepareAndExecuteRequestAsync>d__2.MoveNext() in \hdinsight-phoenix-sharp-master\hdinsight-phoenix-sharp-master\PhoenixSharp\PhoenixClient.cs:line 74
Stack Trace :    at PhoenixSharp.PhoenixClient.<PrepareAndExecuteRequestAsync>d__2.MoveNext() in \hdinsight-phoenix-sharp-master\hdinsight-phoenix-sharp-master\PhoenixSharp\PhoenixClient.cs:line 74"

Updating to .Net Core

Hello all,

I needed to use this library in a .Net Core project so I ported the source code to .Net Core without any code change and it seems to be working. I was wondering if we could merge the .Net Core version into the source and maybe the Nuget package could be updated.

Could this be possible?

How to get or convert the corrent value of datetime?

I use the phoenix to create a table (eg:user table) including the property using date type,then get this value using PrepareAndExecuteRequestAsync method.But I find the value's Rep is integer type not JavaSqlDate or JavaSqlTime or JavaUtilDate and its columnclassname is "java.sql.Date",so How to get or convert the corrent value of datetime? Could you give me an an example? Thanks.

prepareAndExecute works fine but preparing then executing a query returns the following from the server:

� java.lang.IllegalArgumentException: cannot convert false (class java.lang.Boolean) to PRIMITIVE_BOOLEAN
at org.apache.calcite.avatica.remote.TypedValue.serialToLocal(TypedValue.java:242)
at org.apache.calcite.avatica.remote.TypedValue.serialToJdbc(TypedValue.java:309)
at org.apache.calcite.avatica.remote.TypedValue.toJdbc(TypedValue.java:290)
at org.apache.calcite.avatica.jdbc.JdbcMeta.execute(JdbcMeta.java:793)
at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:234)
at org.apache.calcite.avatica.remote.Service$ExecuteRequest.accept(Service.java:1167)
at org.apache.calcite.avatica.remote.Service$ExecuteRequest.accept(Service.java:1145)
at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:102)
at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38)
at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
�]IllegalArgumentException: cannot convert false (class java.lang.Boolean) to PRIMITIVE_BOOLEAN �����*�000002�

Unable to run VNetTests.cs with Hortonworks Data Platform (2.3 and 2.4)

First of all, thanks for your effort.
I'm able to connect Azure PQS from the unit testing code and it is working fine.
I would like to use, VNetTests.cs unit testing code by connecting my local HDP ( Hortonworks Data Platform version 2.3 and 2.4) virtualbox images, but both the versions are failed with 404 error.
In both the versions(2.3 & 2.4), I've installed and configured Phoenix Query Server and I'm able to connect them via sqlline.py(JDBC) and it is working fine.
When I tried from .net based unit testing, I'm getting 404 error.
Can you please let me know, do I need to do any additional setup in the HDP to query it from .net application?

Thanks in advance.

select counts doesn't work on my environment

Hi!

When I execute the tests (f.e. SimpleTest) it fails in the select count(*) with:
Exception thrown: 'System.ArgumentOutOfRangeException' in Google.Protobuf.dll

The response is:

  •   execResponse3	{{ "results": [ { "connectionId": "df5b8c40", "statementId": 56, "ownStatement": true, "signature": { "columns": [ { "caseSensitive": true, "searchable": true, "signed": true, "displaySize": 40, "label": "COUNT(1)", "columnName": "COUNT(1)", "tableName": "PERSONSDF5B8C40", "readOnly": true, "columnClassName": "java.lang.Long", "type": { "id": 4294967291, "name": "BIGINT", "rep": "PRIMITIVE_LONG" } } ], "cursorFactory": { "style": "LIST" } }, "firstFrame": { "done": true }, "updateCount": "18446744073709551615", "metadata": { "serverAddress": "wn0-pcvtes:8765" } } ], "metadata": { "serverAddress": "wn0-pcvtes:8765" } }}	Apache.Phoenix.ExecuteResponse
    

The firstFrame doesn't have any number so it breaks.

I am using Azure, HDI 3.4.1.

Any ideas?

Thanks

String Parameter and Int Parameter combination causes InvalidProtocolBufferException

I have been successful with one or more parameters that are data type string only, but when I introduce an integer as a parameter, I receive a ProtoBuf exception. My unit test's stack trace is shown below. I've looked through the unit tests for this project and some usage from the twitter streaming project, but have only found examples of string only parameter sets.

My unit test code (CommandPrepareWith1String1IntParamsTest) can be found in my repo at: https://github.com/dwdii/GarudaUtil/blob/master/Garuda.Data.Test/PhoenixUnitTest.cs

The error message is:

Google.Protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.

Result StackTrace:  
at Google.Protobuf.CodedInputStream.RefillBuffer(Boolean mustSucceed)
   at Google.Protobuf.CodedInputStream.ReadRawByte()
   at Google.Protobuf.CodedInputStream.SlowReadRawVarint32()
   at Google.Protobuf.CodedInputStream.ReadRawVarint32()
   at Google.Protobuf.CodedInputStream.ReadString()
   at Apache.Phoenix.WireMessage.MergeFrom(CodedInputStream input)
   at Google.Protobuf.MessageExtensions.MergeFrom(IMessage message, Stream input)
   at Google.Protobuf.MessageParser`1.ParseFrom(Stream input)
   at PhoenixSharp.PhoenixClient.<ExecuteRequestAsync>d__4a.MoveNext()
 --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Garuda.Data.PhoenixConnection.InternalExecuteRequest(PrepareResponse prepared, String sql, PhoenixParameterCollection parameterValues) in C:\Code\DotNet\GarudaUtil\Garuda.Data\PhoenixConnection.cs:line 267
   at Garuda.Data.PhoenixCommand.Execute() in C:\Code\DotNet\GarudaUtil\Garuda.Data\PhoenixCommand.cs:line 235
   at Garuda.Data.PhoenixCommand.ExecuteNonQuery() in C:\Code\DotNet\GarudaUtil\Garuda.Data\PhoenixCommand.cs:line 136
   at Garuda.Data.Test.PhoenixUnitTest.CommandPrepareWith1String1IntParamsTest() in C:\Code\DotNet\GarudaUtil\Garuda.Data.Test\PhoenixUnitTest.cs:line 285
Result Message: 
Test method Garuda.Data.Test.PhoenixUnitTest.CommandPrepareWith1String1IntParamsTest threw exception: 
System.AggregateException: One or more errors occurred. ---> Google.Protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either than the input has been truncated or that an embedded message misreported its own length.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.