|
@@ -83,25 +83,4 @@ class ODPSUtils:
|
|
|
|
|
|
|
|
|
|
|
|
-# 示例用法
|
|
|
-if __name__ == "__main__":
|
|
|
-
|
|
|
- # 创建ODPS工具类实例
|
|
|
- odps_utils = ODPSUtils()
|
|
|
- third_party_user_id = '7881300295218216'
|
|
|
- # 示例1: 查询数据
|
|
|
- sql = f"""
|
|
|
- SELECT * FROM third_party_user_date_version
|
|
|
- WHERE dt between '20250612' and '20250612' -- 添加分区条件
|
|
|
- and third_party_user_id = {third_party_user_id}
|
|
|
- and profile_data_v1 is not null
|
|
|
- order by dt desc
|
|
|
- limit 1
|
|
|
- """
|
|
|
- result_df = odps_utils.execute_sql(sql)
|
|
|
-
|
|
|
- if result_df is not None and not result_df.empty:
|
|
|
- print("查询结果预览:")
|
|
|
- print(result_df.head())
|
|
|
-
|
|
|
|