Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample应用里 distinct_id 为空 #17

Open
white-shiro-bai opened this issue Apr 9, 2021 · 0 comments
Open

sample应用里 distinct_id 为空 #17

white-shiro-bai opened this issue Apr 9, 2021 · 0 comments

Comments

@white-shiro-bai
Copy link
Owner

2021-04-08 22:00:23.839372,recall_baidu_bdvid,select date,created_at,distinct_id,SUBSTRING_INDEX(SUBSTRING_INDEX(JSON_EXTRACT(all_json, '$."properties"."$url"'),'bd_vid=',-1),'"',1)as bdvid,JSON_EXTRACT(all_json, '$."properties"."$url"'),all_json from **** where distinct_id in () and event='$pageview' and JSON_EXTRACT(all_json, '$."properties"."$url"') like '%bd_vid%' having LENGTH(bdvid)>0 ORDER BY created_at desc limit 1Traceback (most recent call last):
File "/data/ghost_sa/trigger_jobs/sample.py", line 28, in recall_baidu_bdvid
bdvid_result, bdvid_count = select_tidb(sql=sql_find_last_bdvid)
File "/data/ghost_sa/component/db_op.py", line 40, in select_tidb
result_count = cur.execute(query=sql, args=args)
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/cursors.py", line 170, in execute
result = self._query(query)
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/cursors.py", line 328, in _query
conn.query(q)
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/connections.py", line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
result.read()
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/connections.py", line 1075, in read
first_packet = self.connection._read_packet()
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/connections.py", line 684, in _read_packet
packet.check_error()
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "/usr/local/python3/lib/python3.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 237 near ") and event='$pageview' and JSON_EXTRACT(all_json, '$."properties"."$url"') like '%bd_vid%' having LENGTH(bdvid)>0 ORDER BY created_at desc limit 1" ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant