ERROR: b of OFFSET b clause is not supported for expressions
Posted: Tue Oct 30, 2012 9:49 pm
I'm connecting to Vertica thru JDBC, and I'm getting the below error while calling Connection.prepareStatement on the below SQL. Does anyone know what the error means and how to fix it?
java.sql.Connection Error calling Connection.prepareStatement:
java.sql.SQLException: [Vertica][VJDBC](2013) ERROR: b of OFFSET b clause is not supported for expressions
SELECT COALESCE(COUNT(main.v0), 0) AS CollapsingFunction0
FROM
(SELECT p.ID AS v0,
p.RatingAvgApproved AS v1,
p.ReviewCountApproved AS v2,
p.RatingAvgRejected AS v3,
p.ReviewCountRejected AS v4,
p.Views_all_dates AS v5,
p.Views_365_days AS v6,
p.Visitors_30_days AS v7,
COALESCE(COUNT(r.ID), 0) AS v8,
COALESCE(AVG(r.Rating), 0) AS v9
FROM cabelas.Review r
JOIN
(SELECT nr.ProductID
FROM cabelas.NotificationReason nr
WHERE nr.UserID = ?) pstReviewFilterTable ON pstReviewFilterTable.ProductID = r.ProductID
JOIN cabelas.Product p ON p.ID = r.ProductID
JOIN
(SELECT nr.ProductID
FROM cabelas.NotificationReason nr
WHERE nr.UserID = ?) pstProductFilterTable ON pstProductFilterTable.ProductID = p.ID
WHERE 1 = 1
AND r.Status IN (?)
AND r.ProductInactive = ?
AND r.SubmissionTime >= ?
AND r.SubmissionTime < ?
GROUP BY p.ID,
p.RatingAvgApproved,
p.ReviewCountApproved,
p.RatingAvgRejected,
p.ReviewCountRejected,
p.Views_all_dates,
p.Views_365_days,
p.Visitors_30_days
HAVING COUNT(r.ID) >= ?
LIMIT ?
OFFSET ?) main
java.sql.Connection Error calling Connection.prepareStatement:
java.sql.SQLException: [Vertica][VJDBC](2013) ERROR: b of OFFSET b clause is not supported for expressions
SELECT COALESCE(COUNT(main.v0), 0) AS CollapsingFunction0
FROM
(SELECT p.ID AS v0,
p.RatingAvgApproved AS v1,
p.ReviewCountApproved AS v2,
p.RatingAvgRejected AS v3,
p.ReviewCountRejected AS v4,
p.Views_all_dates AS v5,
p.Views_365_days AS v6,
p.Visitors_30_days AS v7,
COALESCE(COUNT(r.ID), 0) AS v8,
COALESCE(AVG(r.Rating), 0) AS v9
FROM cabelas.Review r
JOIN
(SELECT nr.ProductID
FROM cabelas.NotificationReason nr
WHERE nr.UserID = ?) pstReviewFilterTable ON pstReviewFilterTable.ProductID = r.ProductID
JOIN cabelas.Product p ON p.ID = r.ProductID
JOIN
(SELECT nr.ProductID
FROM cabelas.NotificationReason nr
WHERE nr.UserID = ?) pstProductFilterTable ON pstProductFilterTable.ProductID = p.ID
WHERE 1 = 1
AND r.Status IN (?)
AND r.ProductInactive = ?
AND r.SubmissionTime >= ?
AND r.SubmissionTime < ?
GROUP BY p.ID,
p.RatingAvgApproved,
p.ReviewCountApproved,
p.RatingAvgRejected,
p.ReviewCountRejected,
p.Views_all_dates,
p.Views_365_days,
p.Visitors_30_days
HAVING COUNT(r.ID) >= ?
LIMIT ?
OFFSET ?) main