Apache.Hadoop.Hive.ThriftHive.Client.fetchOne C# (CSharp) 메소드

fetchOne() 공개 메소드

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

Usage Example

예제 #1
0
파일: Program.cs 프로젝트: zbw911/CS4Hadoop
        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();
        }