thrift

Querying database through Hive/Thrift in PHP does not work

人走茶凉 提交于 2019-12-21 19:40:46
问题 I'm trying to query a database through Hive/Thrift in PHP. However, I am constantly getting an error: TSocket: timed out reading 4 bytes from XYZ I'm using a code from https://cwiki.apache.org/Hive/hiveclient.html#HiveClient-PHP along with this PHP Thrift Client https://github.com/garamon/php-thrift-hive-client My code: <?php $socket = new TSocket( 'XYZ', 12345 ); $socket->setSendTimeout(30 * 1000); $socket->setRecvTimeout(30 * 1000); $transport = new TBufferedTransport( $socket, 1024, 1024 )

How do you say in a Thrift IDL that a client should include exactly one of a set of fields in a struct?

戏子无情 提交于 2019-12-21 16:51:52
问题 Suppose I have defined a struct in an Apache Thrift IDL file which contains two fields. For example: struct Thing { 1: optional string name, 2: optional i32 size } This means a client can supply a Thing object with no fields, a name, a size, or a name and a size. But what if I want a Thing object to have either a name or a size (exclusive or)? At the moment I have to use my implementation code to guard against a client supplying a Thing with no fields or both fields; and also document/comment

Symmetric encryption (AES) in Apache Thrift

人盡茶涼 提交于 2019-12-21 06:27:22
问题 I have two applications that interact using Thrift. They share the same secret key and I need to encrypt their messages. It makes sense to use symmetric algorithm (AES, for example), but I haven't found any library to do this. So I made a research and see following options: Use built-in SSL support I can use built-in SSL support, establish secure connection and use my secret key just as authentication token. It requires to install certificates in addition to the secret key they already have,

How to I get started with Apache Thrift? [closed]

本秂侑毒 提交于 2019-12-20 08:48:53
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I wanted to create a simple Thrift server for C++ and provide a client with Python language. I went to the official site but it lacks

Difference between Apache Thrift and ZeroMQ

谁都会走 提交于 2019-12-20 08:48:37
问题 I understand that Apache Thrift and ZeroMQ are softwares belonging to different categories, and it is not easy to do a comparison since it is an apple to orange comparison. But I don't know why they belong to different categories. Aren't they both used to pass data between different services, which may or may not be written in different languages? When should I use Thrift and when should I use a message queue? 回答1: They belong to different categories primarily because they are targetted at

Electron+Python软件系统开发记录(一):基础环境搭建

南笙酒味 提交于 2019-12-20 04:48:57
Electron+Python软件系统开发记录(一):基础环境搭建 1.问题说明 最近开始做本科毕设,其中有一部分内容是搭建一个完整的软件系统。系统要求就是常见的客户端,服务器,数据库的整体架构。因为本科不是计算机系的,所以学习的相关技能少,以前写课程设计一般用QT或者MFC,还有Mac的OC语言。本着多学习的态度,这次选用了Electron框架,可以迫使自己学学html,css,js这些东西。后端因为需要大量数据处理和深度学习,因此采用python。这个文档会持续更新,记录自己的系统开发过程。 2.框架简介 Electron 是用js,html,css开发客户端APP的框架。我的理解就是给网页套了个壳,打开桌面软件好像打开了一个chorme一样。 3.通信方式选择 经过调研,发现网上的Electron+python程序实现前后端通信的方式主要有三种: http zerorpc thrift 这里的通信是指桌面端前端和本地后台的通信,用http不太合适,也太笨重了。 跟着网上的demo搞了一天zerorpc这个方式,最后也没成功。大概看了一下,zerorpc其中的依赖zeromq好像已经停止更新维护了。并且其存在很多版本问题,报错说需要abi编号为75的node.js版本,但是我去官网看,最新的一些版本都是79(我用的node12.13.1),再往前是72,没有75的

How to connect to hive using python pyhs2?

无人久伴 提交于 2019-12-20 02:54:12
问题 I am trying to access hive using pyhs2 . I tried the following code: example.py import pyhs2 conn = pyhs2.connect(host='localhost', port=10000,authMechanism=None, user=None, password=None,database='default') with conn.cursor() as cur: cur.execute("select * from table") for i in cur.fetch(): print i I am getting the following error: Traceback (most recent call last): File "example.py", line 2, in <module> conn = pyhs2.connect(host='localhost', port=10000,authMechanism=None, user=None, password

Sending a stream as a property in Apache Thrift C#

早过忘川 提交于 2019-12-20 02:22:52
问题 I would like to consume a stream in a thrift service, for example, in a service method to have a stream or something similar as an argument to the method (for example, to be able to serialize the result from an IDataReader to a stream, and then deserialize the reference to the data on the other server side). I don't think that this is explicitly possible, but I was wondering if there was another way to achieve something similar. Thanks. 回答1: Apache thrift does not support sending streams. The

how can I define a map accept different kind of value in thrift?

只愿长相守 提交于 2019-12-19 11:25:13
问题 I define a struct with thrift: struct QuerySetRecord { 1:string recordId, 2:string crawlerName, 3:string recordType, 4:map<string,string> dataMap, 5:i16 priority, } the problem is the dataMap , I do not only want to accept string value, I may still want to accept List or Map , such as map<string, list<string>> dataMap . In other words, I want a type like the root Object in Java, object in python Can I do this? 回答1: You would have to create your own Object and list all possible classes in it.

Loop through specific resource files in maven to generate sources

假装没事ソ 提交于 2019-12-19 11:22:48
问题 I use maven-antrun-plugin to generate sources from thrift IDL. I have a separate project (and jar) to hold these generated sources and this plugin does not support wildcard replacement, so I cannot say *.thrift. I use execution tasks to generate the sources and copy them to src directory. I have the following plugin defined <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <tasks> <mkdir dir