Hive.GROUPINGSETS有BUG?
随着Hive 0.10版的发布,GROUPING SETS出现了,并提供了ROLL UP和CUBE这两个特殊场景的子句,真是喜闻乐见的特性
随着Hive 0.10版的发布,GROUPING SETS出现了,并提供了ROLL UP和CUBE这两个特殊场景的子句,真是喜闻乐见的特性啊。不过最近在写两个HQL查询脚本的时候,我发现,对表达式进行GROUP BY并用GROUPING SETS自定义这些表达式的分组方式时,GROUPING SETS好像会出现解析异常:
FAILED: ParseException line 66:14 missing ) at ',' near ')' in subquery source line 66:80 mismatched input ',' expecting ) near ')' in subquery source
group by t1.my_month, t1.product, t1.usr_type, if(t3.earliest_logtime_monthly = '20140101', 'new_usr', 'old_usr'), if(t2.CTClass = 105, t1.ipcountry, t1.ipprovince), t1.ChannelID grouping sets ((t1.my_month, t1.usr_type, t1.ChannelID), (t1.my_month, t1.product, t1.usr_type, t1.ChannelID), (t1.my_month, if(t3.earliest_logtime_monthly = '20140101', 'new_usr', 'old_usr'), t1.ChannelID), (t1.my_month, t1.product, if(t3.earliest_logtime_monthly = '20140101', 'new_usr', 'old_usr'), t1.ChannelID), (t1.my_month, if(t2.Dim_CityClass = 105, t1.ipcountry, t1.ipprovince), t1.ChannelID), (t1.my_month, t1.product, if(t2.CTClass = 105, t1.ipcountry, t1.ipprovince), t1.ChannelID))
理论上,表达式和字段应该一样,可以出现在GROUPING SETS子句里并进行任意组合,对一些表达式的实测结果也表明GROUPING SETS里确实是支持表达式的。
这样的情况,使我怀疑GROUPING SETS子句的括号匹配逻辑没做得很完善,导致了括号配对抛出异常。不过,具体的问题,还是需要通过研究一下Hive实现源码来进一步确定这到底是不是一个BUG。
--------------------------------------------------------------------------------------------------------------------
2014-04-28
今天发现,好像是限定性名称的原因呢!就和Java的switch...case的case子句一样,case子句里的枚举值不能用限定性名称(EnumType.EnumValue1),只能用非限定性名称(EnumValue1)!难道grouping sets的Java实现涉及到switch...case子句?有待研究。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

As Apple's WWDC conference 2024 came to a successful conclusion, not only macos15 was announced, but the update of Apple's new iOS18 system attracted the most attention. Although there are many new features, as the first version of Apple's iOS18, people inevitably wonder whether it is necessary to upgrade Apple. iOS18, what kind of bugs are there in the latest release of Apple iOS18? After real use evaluation, the following is a summary of Apple iOS18 bugs, let’s take a look. Currently, many iPhone users are rushing to upgrade to iOS18. However, various system bugs are making people uncomfortable. Some bloggers said that you should be cautious when upgrading to iOS18 because "there are so many bugs." The blogger said that if your iPhone is

What do game bugs mean? During the process of playing games, we often encounter some unexpected errors or problems, such as characters getting stuck, tasks being unable to continue, screen flickering, etc. These abnormal phenomena are called game bugs, that is, faults or errors in the game. In this article, we'll explore what game bugs mean and the impact they have on players and developers. Game bugs refer to errors that occur during the development or operation of the game, causing the game to fail to run normally or to behave unexpectedly. These errors may be due to

System bagage refers to system bug; the original meaning of bug is "bug", and now it can be used to refer to vulnerabilities that exist on the computer. The reason is that there are flaws in the system security policy, and there is a danger that attackers can access without authorization; in a broad sense On the topic, bug can be used to describe loopholes or defects that appear in various fields.

Some people want to update win11, but they don’t know if there are many bugs in win11 and whether the update will cause problems. In fact, there are bugs in win11 now, but they have little impact on use. Are there many bugs in win11? Answer: There are still many bugs in win11. However, these bugs have little impact on daily use. If the user has high requirements for daily use, it is recommended to use it later. Summary of win11 bugs 1. Resource Manager 1. Sometimes memory overflow occurs, resulting in high memory usage of the Resource Manager. 2. This situation will cause the memory to occupy more than 70%, causing the computer to freeze or even crash. 2. Conflict and crash 1. Some applications are not compatible enough, causing conflicts with each other. 2. Although there are relatively few conflict procedures,

In recent years, data warehouses have become an integral part of enterprise data management. Directly using the database for data analysis can meet simple query needs, but when we need to perform large-scale data analysis, a single database can no longer meet the needs. At this time, we need to use a data warehouse to process massive data. Hive is one of the most popular open source components in the data warehouse field. It can integrate the Hadoop distributed computing engine and SQL queries and support parallel processing of massive data. At the same time, in Go language, use

PHP is a widely used server-side programming language that is used in almost all industries. In this article, we will explore the special role of PHP in big data processing. Under certain circumstances, PHP can collaborate with ApacheHive to achieve real-time data processing and analysis. First, let’s introduce Hive. Hive is a Hadoop-based data warehouse solution. It can map structured data into SQL queries and execute the queries as MapReduce tasks.

The life cycle of a BUG is the process from when a BUG is discovered to when the BUG is closed. The specific process is: 1. Discover the BUG, that is, discover the loopholes or defects in the software program; 2. Submit the bug and try to describe the attributes and reproduction of the defect. Environment, type, level, priority and detailed reproduction steps, results and expectations, etc.; 3. Assign the bug, that is, assign the problem directly to the corresponding developer; 4. Analyze and confirm it as a defect; 5. Handle and fix the BUG; 6. Regression verification BUG; 7. Close BUG.

As data processing becomes more and more important, big data analysis becomes more and more common. However, many companies may not want to spend a lot of money on a business analytics platform. Open source solutions offer these companies a viable option. In this article, we will discuss how to implement the open source Hive big data analysis platform using PHP. Hive is a Hadoop-based data warehouse system that can query and manage large-scale data sets on Hadoop through SQL. It uses the SQL-like HiveQL language to query
