{question}
Why am I getting the error message "Feature 'reshuffling a singleton select' is not supported by MemSQL Distributed"?
{question}
{answer}
This error message is a standard lockdown message in SingleStore. This means that the generated query plan is trying to do something that is not permitted, so it gets rejected and errors out. The issue is with a singleton select. This is a select or a subselect, which is returning a scalar value (a result which is one column and one row, literally just one thing). So another word for this is scalar subselect.
The problem with this is that typically in a query plan like this, the operator would reshuffle the result at that point. This means repartitioning that result, typically in preparation for a join or group by, to ensure that all identical values will be stored in the same partition and can be locally joined. However, as you might imagine, it makes no sense to reshuffle a single result. Hence it is erroring out.
To workaround this behavior and error, find the singleton select returning a scalar value, and be sure you are not joining on it (or performing another operation that could necessitate a repartition, like a group by) in your query text.
{answer}