Is it possible to write a sensible validation query in Apache Phoenix?
I want something that will send a trivial query to the database, and return a small and predictable result, with no assumptions as to what is already stored in the database. It gets used simply as a way of confirming that the database is alive and responding to requests.
In MySQL, I use SELECT 1
, which works admirably. But Phoenix doesn't support this: it insists on having it as SELECT 1 FROM table
, and it complains if there's no such table. This is no use to me: it relies on the existence of a particular table on the database.
The best I have come up with so far is
DROP SEQUENCE IF EXISTS completelyimplausiblesequencename
which works, but it's a bit hacky and inelegant, and it does, in principle, alter state.
Anything better?