phoenix與squirrel-sql結合或phoenix-sqlline.py啓動後展示查詢時區Timezone差8個小時問題

  • 場景
    (1):spark程序中使用java.sql.Timestamp插入phoenix表結構爲register_time(Timestamp)。
    (2):squirrel-sql中使用此種方式查詢select register_time,register_date from user where register_time= to_timestamp(‘2016-01-21 12:15:34’)
    (3):使用phoenix非thin版本,而是使用phoenix-*-client.jar
  • 方案
    (1):phoenix-*-client.jar中添加hbase-site.xml文件
    (2):hbase-site.xml文件配置如下:
    <configuration>
      <property>
        <name>phoenix.schema.isNamespaceMappingEnabled</name>
        <value>true</value>
      </property>
    
      <property>
        <name>phoenix.queryserver.serialization</name>
        <value>JSON</value>
      </property>
      <property>
        <name>phoenix.query.dateFormatTimeZone</name>
        <value>GMT+08:00</value>
      </property>
    </configuration>
    
  • 展示
    在這裏插入圖片描述
    更多大數據相關問題、或者互聯網金融相關問題可以諮詢我,免費解答,或者添加我的微信號18310801089
    在這裏插入圖片描述
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章