Apache.Hadoop.Hive.ThriftHive.Client.fetchOne C# (CSharp) Method

fetchOne() public method

public fetchOne ( ) : string
return string
            public string fetchOne()
            {
                send_fetchOne();
                return recv_fetchOne();
            }

Usage Example

Ejemplo n.º 1
0
        public static void query()
        {
            var transport = new TBufferedTransport(new TSocket("hserver", 10000));
            var protocol = new TBinaryProtocol(transport);
            var client = new ThriftHive.Client(protocol);

            transport.Open();

            //client.execute("CREATE TABLE r(a STRING, b INT, c DOUBLE)");
            //client.execute("LOAD TABLE LOCAL INPATH '/path' INTO TABLE r");
            client.execute("SELECT * FROM pokes where foo=180");
            while (true)
            {
                var row = client.fetchOne();
                if (string.IsNullOrEmpty(row))
                    break;
                System.Console.WriteLine(row);
            }
            client.execute("SELECT * FROM pokes");
            var all = client.fetchAll();

            System.Console.WriteLine(all);

            transport.Close();
        }