From user-return-1041-archive-asf-public=cust-asf.ponee.io@arrow.apache.org Tue Mar 2 13:39:10 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 76B6D180630 for ; Tue, 2 Mar 2021 14:39:10 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id EC4CF64822 for ; Tue, 2 Mar 2021 13:39:08 +0000 (UTC) Received: (qmail 56751 invoked by uid 500); 2 Mar 2021 13:39:07 -0000 Mailing-List: contact user-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@arrow.apache.org Delivered-To: mailing list user@arrow.apache.org Received: (qmail 56741 invoked by uid 99); 2 Mar 2021 13:39:07 -0000 Received: from spamproc1-he-fi.apache.org (HELO spamproc1-he-fi.apache.org) (95.217.134.168) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2021 13:39:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-fi.apache.org (ASF Mail Server at spamproc1-he-fi.apache.org) with ESMTP id 29698C033D for ; Tue, 2 Mar 2021 13:39:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-fi.apache.org X-Spam-Flag: NO X-Spam-Score: -0.201 X-Spam-Level: X-Spam-Status: No, score=-0.201 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamproc1-he-fi.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=raedisch.net Received: from mx1-ec2-va.apache.org ([116.203.227.195]) by localhost (spamproc1-he-fi.apache.org [95.217.134.168]) (amavisd-new, port 10024) with ESMTP id gqlBqs_kJUom for ; Tue, 2 Mar 2021 13:39:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.70.41.114; helo=mail-41114.protonmail.ch; envelope-from=jasper@raedisch.net; receiver= Received: from mail-41114.protonmail.ch (mail-41114.protonmail.ch [185.70.41.114]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 87F0EBCF9E for ; Tue, 2 Mar 2021 13:39:05 +0000 (UTC) Date: Tue, 02 Mar 2021 13:39:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raedisch.net; s=protonmail; t=1614692343; bh=ZzE9pZJ2rMCQgDzZ/EksMKWAHmFe/b5Eb5f3jDfbUBI=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=xWalxHIMJVFyVvguSjPkSiXgvY1JGwp4QL2bo/l/QUT44mRkyL1BaUUZAg9/7FayC rRF+9SMKjfTIsfvBv3sop4PiT/5ujAZLmr3JJFwm6UZ3ALMSphBJH4XkYbKGsYhV+p p8+Q6s9e8WdcpGEyR3t7Ix5WNcIBpHhoW/m2V2ao= To: "user@arrow.apache.org" From: =?utf-8?Q?Jasper_R=C3=A4disch?= Reply-To: =?utf-8?Q?Jasper_R=C3=A4disch?= Subject: [go+Flight] DoExchange missing Descriptor Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ok, turned out to be rather simple: ``` err =3D doEX.Send(&flight.FlightData{FlightDescriptor: &flight.FlightDescri= ptor{Type: flight.FlightDescriptor_CMD, Cmd: []byte("test")}}) ``` Sorry for the distraction! =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Tuesday, March 2, 2021 7:55 AM, Jasper R=C3=A4disch wrote: > Hi everyone, > > newbie trying to get into Flight with Go here. > > Invoking DoAction was pretty straight forward, but now I have problems wi= th DoExchange, namely: > > rpc error: code =3D Unknown desc =3D Descriptor missing on first mes= sage > > > I managed wrapping flight.FlightServiceClient.DoExchange into a flight.Ne= wRecordWriter, but there is AFAIK no way to set the FlightDescriptor, which= lead me to the assumption, that the first message has to be sent manually = via DoEX.Send(). > > Is there a preferred way/helper to build said FlightData? Am I on the rig= ht track at all? I will keep digging into the source, but am thankful for a= ny help. > > Jasper > > Complete client.go so far: > > package main > > import ( > =09"context" > =09"fmt" > =09"time" > > =09"github.com/apache/arrow/go/arrow" > =09"github.com/apache/arrow/go/arrow/array" > =09"github.com/apache/arrow/go/arrow/flight" > =09"github.com/apache/arrow/go/arrow/ipc" > =09"github.com/apache/arrow/go/arrow/memory" > =09"google.golang.org/grpc" > ) > > func main() { > =09conn, err :=3D grpc.Dial("localhost:3001", grpc.WithInsecure(), gr= pc.WithBlock()) > =09c :=3D flight.NewFlightServiceClient(conn) > =09ctx, cancel :=3D context.WithTimeout(context.Background(), 100*tim= e.Second) > =09defer cancel() > =09if err !=3D nil { > =09=09panic(err) > =09} > =09defer conn.Close() > =09i :=3D 0 > =09doEX, err :=3D c.DoExchange(ctx) > =09if err !=3D nil { > =09=09panic(err) > =09} > =09// md :=3D arrow.NewMetadata([]string{"f1-i64"}, []string{"v3"}) > =09schema :=3D arrow.NewSchema([]arrow.Field{ > =09=09{Name: "f1-i64", Type: arrow.PrimitiveTypes.Int64}, > =09}, nil) > =09pool :=3D memory.NewGoAllocator() > =09w :=3D flight.NewRecordWriter(doEX, ipc.WithSchema(schema), ipc.Wi= thAllocator(pool)) > =09b :=3D array.NewRecordBuilder(pool, schema) > =09defer b.Release() > > =09for { > =09=09b.Field(0).(*array.Int64Builder).Append(int64(i)) > =09=09r :=3D b.NewRecord() > =09=09w.Write(r) > =09=09if err !=3D nil { > =09=09=09panic(err) > =09=09} > =09=09fmt.Println(doEX.Recv()) > =09=09defer r.Release() > =09=09time.Sleep(1 * time.Second) > =09=09i =3D i + 1 > =09=09if i =3D=3D 10 { > =09=09=09break > =09=09} > =09} > =09doEX.CloseSend() > } >