هل يجب أن أتمكن من تشغيل أي استعلام لشارة في مستكشف البيانات؟
أريد إنشاء استعلام مخصص للشارات باستخدام “مُقدَّر” كنقطة انطلاق. أقوم بإدخال استعلام مُقدَّر في مستكشف البيانات:
SELECT p.user_id, current_timestamp AS granted_at
FROM posts AS p
WHERE p.like_count >= 1
AND (:backfill OR p.user_id IN (:user_ids))
GROUP by p.user_id
HAVING count(*) > 20
يؤدي هذا إلى ظهور خطأ:
missing value for :backfill
أفهم بشكل ضبابي أن “الفاصلة المنقوطة” تمثل “متغير ربط” مما يحسن الكفاءة. حاولت إزالة جزء الـ backfill، لكن ذلك أدى إلى ظهور خطأ آخر.
You will need to leave out the AND (:backfill OR p.user_id IN (:user_ids)) condition to run the query in the Data Explorer. :backfill and :user_ids both expect parameters to be passed to them.
Thanks, it seems to work fine without the AND clause. Can you tell me what the clause does (assuming it gets the parameters passed in), so I can decide whether to keep it?
If your badge is triggered by a user acting on a post, then you need to include this condition. The best description I’ve seen of how the :backfill and :user_ids parameters are used in badge queries is in the ‘Triggered badges have 2 extra constraints’ section of Create Triggered Custom Badge Queries.