show global variables like '%mode%';
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
其中如果为支持给表名加上双引号可以添加上选项ANSI_QUOTES,即有:
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES'
################################################################################################
但是这样会遇到下面这样的问题,会把root.default当成表来对待,因此,尽量避免使用该参数。
################################################################################################
select queue_name,max(numActiveApps),max(numPendingApps),max(maxApps),max(usedResourceVcores),
max(expectedFairShareVcores),max(maxResourceVcores),max(usedResourceMemory),
max(expectedFairShareMemory),max(maxResourcememory)
from monitor
where cluster_name='azmbcommonprc-hadoop'
and queue_name in ("root.default")
and time > '2020-07-06 11:04:40' group by queue_name;