Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 liveuser 1
<?php
2
 
3
#指派命名空間
4
namespace qbpwcf{
5
 
6
	#匯入專屬SOAP的套件
7
	include("../allInOne.php");
8
 
9
	#提示執行的函數
10
	echo "<hr>hive::query - testCase 1<p>";
11
 
12
	/*
13
 
14
	#涵式說明:
15
	#執行hiveSQL
16
	#回傳結果:
17
	#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
18
	#$result["functin"],字串,當前函數的名稱.
19
	#$result["error"],陣列,錯訊訊息.
20
	#$result["content"],執行完query的回傳內容.
21
	#$result["cmd"],執行的指令.
22
	#必填參數:
23
	#$conf["sql"],字串,要執行的sql字串.
24
	$conf["sql"]="show databases";
25
	#$conf["beeline"],字串,beeline程式的位置.
26
	$conf["beeline"]="beeline";
27
	#$conf["userName"],字串,執行beeline程式的使用者名稱.
28
	$conf["userName"]="liveuser";
29
	#$conf["userPass"],字串,執行beeline程式的使用者名稱對應的密碼.
30
	$conf["userPass"]="password";
31
	#可省略參數:
32
	#$conf["fileArgu"],字串.__FILE__的內容,若省略,則為伺服器上該檔案的位置.
33
	#$conf["fileArgu"]=__FILE__
34
	#備註:
35
	#尚未測試...
36
	var_dump(hive::query($conf));
37
	unset($conf);
38
 
39
	*/
40
 
41
	#提示執行的函數
42
	echo "<hr>hive::getDtData - testCase 1<p>";
43
 
44
	/*
45
 
46
	#涵式說明:
47
	#執行hiveSQL,取得資料表資料.
48
	#回傳結果:
49
	#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
50
	#$result["functin"],字串,當前函數的名稱.
51
	#$result["error"],陣列,錯訊訊息.
52
	#$result["content"],執行完query的回傳內容.
53
	#$result["cmd"],執行的指令.
54
	#必填參數:
55
	#$conf["beeline"],字串,beeline程式的位置.
56
	$conf["beeline"]="/home/liveuser/hadoop-2.7.2/bin/beeline";		
57
	#$conf["dbName"],字串,要取得資料表資料的目標資料庫名稱.
58
	$conf["dbName"]="test";	
59
	#$conf["dtName"],字串,要取得資料的目標資料表名稱.
60
	$conf["dtName"]="pokes";	
61
	#可省略參數:
62
	#$conf["fileArgu"],字串.__FILE__的內容,若省略,則為伺服器上該檔案的位置.
63
	#$conf["fileArgu"]=__FILE__
64
	#$conf["userName"],字串,執行beeline程式的使用者名稱.
65
	#$conf["userName"]="liveuser";
66
	#$conf["userPass"],字串,執行beeline程式的使用者名稱對應的密碼.
67
	#$conf["userPass"]="password";
68
	#備註:
69
	#建構中...
70
	var_dump(hive::getDtData($conf));
71
	unset($conf);
72
 
73
	*/
74
 
75
	#提示執行的函數
76
	echo "<hr>hive::nativeQuery - testCase 1<p>";
77
 
78
	#/*
79
 
80
	#函數說明:
81
	#apache hive官方提供的PHP API
82
	#回傳結果:
83
	#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
84
	#$result["functin"],字串,當前函數的名稱.
85
	#$result["error"],陣列,錯訊訊息.
86
	#$result["content"],執行完query的回傳內容.
87
	#$result["qStr"],查詢的語句.
88
	#必填參數:
89
	#$conf["thrift_root"],字串,存有 hive 散布的 php THRIFT_ROOT 路徑.
90
	$conf["thrift_root"]="lib/apache-hive";
91
	#可省略參數:
92
	#$conf["fileArgu"],字串,__FILE__的內容,預設為__FILE__.
93
	#$conf["fileArgu"]=__FILE__;
94
	#備註:
95
	#建構中...
96
	var_dump(hive::nativeQuery($conf));
97
 
98
	#*/
99
 
100
	}#namespace includeV5 end	
101
 
102
?>