目录
大家好,我是老六。今天和大家一起来看下hive中内置函数concat的源码。
一、函数使用
hive函数官方文档:LanguageManual UDF - Apache Hive - Apache Software Foundation
二、使用案例
函数使用比较简单
结果
三、源码分析
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hive.ql.udf.generic;
import org.apache.hadoop.hive.common.type.HiveChar;
import org.apache.hadoop.hive.common.type.HiveVarchar;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
import org.apache.hadoop.hive.ql.exec.vector.Ve

文章详细介绍了Hive中内置的concat函数,从函数使用、案例演示到源码分析。在源码部分,探讨了函数如何处理不同类型的数据,如STRING、CHAR、VARCHAR,以及其在处理BINARY数据时的行为。initialize()函数用于初始化,确定返回类型,evaluate()函数则包含了实际的拼接逻辑。
最低0.47元/天 解锁文章
4411

被折叠的 条评论
为什么被折叠?



