SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 64343: A PROC SQL query that joins multiple Hive tables results in "Execute error: Error while compiling statement: FAILED: SemanticException[Error 10017]"

DetailsHotfixAboutRate It

An SQL procedure query that accesses Hive might result in an error similar to the following:

ERROR: Execute error: Error while compiling statement: FAILED: SemanticException
[Error 10017]: Line 1:157 Both left and right aliases encountered in JOIN 'xxxx'

Some of the known PROC SQL queries that have encountered this error are the following:

Case #1

  • running Hive 2.1
  • includes an inner join of two Hive tables
  • a new Hive table is being created with the results
  • the system option DBIDIRECTEXEC is in effect
  • contains a WHERE clause that includes the comparison of two variables using an inequality operator (>, <, and so on)

Case #2

  • running Hive 2.1
  • includes an inner join of two Hive tables
  • contains a WHERE clause that includes the comparison of two variables using an inequality operator (>, <, and so on)
  • includes a GROUP BY clause

The query generated and passed to the database has the WHERE condition added to the ON clause rather than including a WHERE clause. Due to a limitation with Hive 2.1, inequalities are not allowed in the ON clause. 

A workaround is to upgrade to Hive 2.2 where this limitation is addressed.

Click the Hot Fix tab in this note to access the hot fix for this issue. 

After you install the hot fix, you must also add the following statement to your code to enable the fix:

options set=SQLIP_FOLD_WHR_WITH_INEQ_INTO_IJ=NO;

The new environment variable that is added with the hot fix affects all SAS/ACCESS® products. Setting the environment variable to YES or Y reverts to the default setting and results in the predicate folding of the WHERE condition to the ON clause. 

Applying either hot fix from the Hot Fix tab—Hot Fix B6Q073 (SAS® 9.4 TS1M5) or Hot Fix D9T029 (SAS® 9.4 TS1M6)—does not address queries that contain a GROUP BY clause.

Click the Hot Fix tab in this note to access the hot fix for this issue.

 

 



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASMacintosh
Microsoft® Windows® for 64-Bit Itanium-based Systems
Microsoft Windows Server 2003 Datacenter 64-bit Edition
Microsoft Windows Server 2003 Enterprise 64-bit Edition
Microsoft Windows XP 64-bit Edition
Microsoft® Windows® for x64
OS/2
Microsoft Windows 8 Enterprise 32-bit
Microsoft Windows 8 Enterprise x64
Microsoft Windows 8 Pro 32-bit
Microsoft Windows 8 Pro x64
Microsoft Windows 8.1 Enterprise 32-bit
Microsoft Windows 8.1 Enterprise x64
Microsoft Windows 8.1 Pro 32-bit
Microsoft Windows 8.1 Pro x64
Microsoft Windows 10
Microsoft Windows 95/98
Microsoft Windows 2000 Advanced Server
Microsoft Windows 2000 Datacenter Server
Microsoft Windows 2000 Server
Microsoft Windows 2000 Professional
Microsoft Windows NT Workstation
Microsoft Windows Server 2003 Datacenter Edition
Microsoft Windows Server 2003 Enterprise Edition
Microsoft Windows Server 2003 Standard Edition
Microsoft Windows Server 2003 for x64
Microsoft Windows Server 2008
Microsoft Windows Server 2008 R2
Microsoft Windows Server 2008 for x64
Microsoft Windows Server 2012 Datacenter
Microsoft Windows Server 2012 R2 Datacenter
Microsoft Windows Server 2012 R2 Std
Microsoft Windows Server 2012 Std
Microsoft Windows Server 2016
Microsoft Windows Server 2019
Microsoft Windows XP Professional
Windows 7 Enterprise 32 bit
Windows 7 Enterprise x64
Windows 7 Home Premium 32 bit
Windows 7 Home Premium x64
Windows 7 Professional 32 bit
Windows 7 Professional x64
Windows 7 Ultimate 32 bit
Windows 7 Ultimate x64
Windows Millennium Edition (Me)
Windows Vista
Windows Vista for x64
64-bit Enabled AIX
64-bit Enabled HP-UX
64-bit Enabled Solaris
ABI+ for Intel Architecture
AIX
HP-UX
HP-UX IPF
IRIX
Linux
Linux for x64
Linux on Itanium
OpenVMS Alpha
OpenVMS on HP Integrity
Solaris
Solaris for x64
Tru64 UNIX
SAS SystemSAS ViyaLinux for x643.33.5Viya
Microsoft® Windows® for x643.43.5ViyaViya
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.