Teradata与Hive相当

时间:2016-12-29 11:31:30

标签: sql hadoop hive teradata

我正在尝试将Teradata查询转换为Hive查询。

部分转换的查询是:

*** Terminating app due to uncaught exception 'NSRangeException', reason:
'*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000103b5934b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00000001035ba21e objc_exception_throw + 48
    2   CoreFoundation                      0x0000000103a8af1b -[__NSArrayM objectAtIndex:] + 203
    3   Mahroosa                            0x0000000102e207c7 -[MainViewController viewSliderControllerAtIndex:] + 151
    4   Mahroosa                            0x0000000102e21117 -[MainViewController LoadSlides] + 1495
    5   Mahroosa                            0x0000000102e25b32 -[MainViewController TimerTick:] + 98
    6   Foundation                          0x0000000103115144 __NSFireTimer + 83
    7   CoreFoundation                      0x0000000103aeb964 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    8   CoreFoundation                      0x0000000103aeb5f3 __CFRunLoopDoTimer + 1075
    9   CoreFoundation                      0x0000000103aeb17a __CFRunLoopDoTimers + 250
    10  CoreFoundation                      0x0000000103ae2f01 __CFRunLoopRun + 2065
    11  CoreFoundation                      0x0000000103ae2494 CFRunLoopRunSpecific + 420
    12  GraphicsServices                    0x0000000108f2ca6f GSEventRunModal + 161
    13  UIKit                               0x00000001048ebf34 UIApplicationMain + 159
    14  Mahroosa                            0x0000000102e34a2f main + 111
    15  libdyld.dylib                       0x000000010628868d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

我知道Hive不支持非equi连接。

CREATE TABLE x.calendar_day_tmp AS SELECT k.*,s.gregorian_date FROM x.multisave_store_level AS k INNER JOIN x.calendar_day AS s ON gregorian_date BETWEEN start_date AND end_date AND (SELECT MAX(wk) FROM x.climate_data) = s.wk; start_date位于end_date但不在multisave_store_level

calendar_day位于gregorian_date但不在calendar_day

上述查询是否有效解决方案?

0 个答案:

没有答案