You might see the "Query exceeded distributed user memory limit of xxGB" error when you try to import data from Treasure Data with a SQL that uses following operators.
- ORDER BY
- GROUP BY (of many columns)
To workaround the issue, please refer below documents.
https://docs.treasuredata.com/display/public/PD/How+can+I+fix+the+Exceeded+max+local+memory+xxGB+error (English) https://docs.treasuredata.com/pages/releaseview.action?pageId=328022 (Japanese)