注:maxcompute原名odps,是阿裡雲自研的大資料計算平台,文中出現的maxcompute與odps都指代同一平台,不做區分
maxcompute jdbc 2.0 beta 出于易用性的考慮,對配置相關的部分進行了一些變更,大緻如下:
添加了對日志配置的支援
同化了url及prop參數名
之前jdbc的配置參數可以通過url參數的方式傳遞,也可以在程式設計時通過property的方式傳遞,且兩種方式的參數key是不同的,如下所示:
url key
property key
description
<code>endpoint</code>
<code>end_point</code>
the endpoint of the odps cluster
<code>project</code>
<code>project_name</code>
the current odps project
<code>accessid</code>
<code>access_id</code>
the id to access the odps service
<code>accesskey</code>
<code>access_key</code>
the authentication key
<code>logview</code>
<code>logview_host</code>
the host domain of the log view appeared in the log history
<code>lifecycle</code>
the lifecycle of the temp table using in query
<code>charset</code>
the charset of the string
<code>loglevel</code>
<code>log_level</code>
the level of debug infomartion debug/info/fatal
為了便于記憶和使用,目前變更為在這兩種方式中,以上兩種key将通用不作區分,且在兩種key同時存在的情況下,優先使用property key的入參。同時,如果在url和property中都傳入同一參數(不區分key的形式),将優先使用以property方式傳入的參數
支援在jdbc url中傳入配置檔案
之前在jdbc的url串中傳入參數時,存在一個麻煩的地方,即個别參數可能存在特殊字元。例如,有個别的access_key的末尾是以=結束的,這對url參數的解析造成了幹擾,唯一能做的就是需要使用者提前對這些參數的值進行url encoding.
為了避免這種情況發生,目前支援在url串上直接傳入配置檔案,如下:
<code>jdbc:odps:http://10.101.xx.xx/api?odps_config=/users/emerson/odps_config.ini</code>
我們支援在url上傳入 odps_config 作為指定本地配置檔案路徑的參數。其中odps_config.ini的内容如下,就是簡單的鍵值對:
這些參數的key與之前url或property的方式一緻,且含有特殊字元的值也無須轉義。
這裡需要注意的是, odps_config 參數隻支援以url參數的方式傳入,不支援property的方式傳入。一旦傳遞了該配置檔案,将忽略所有通過url或property傳入的參數。
