All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hive.ql.plan.CreateViewDesc Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
/**
 * 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.plan;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.ql.exec.Utilities;

/**
 * CreateViewDesc.
 *
 */
@Explain(displayName = "Create View")
public class CreateViewDesc extends DDLDesc implements Serializable {
  private static final long serialVersionUID = 1L;

  private String viewName;
  private String originalText;
  private String expandedText;
  private List schema;
  private Map tblProps;
  private List partColNames;
  private List partCols;
  private String comment;
  private boolean ifNotExists;
  private boolean orReplace;
  private boolean isAlterViewAs;

  /**
   * For serialization only.
   */
  public CreateViewDesc() {
  }

  public CreateViewDesc(String viewName, List schema,
      String comment, Map tblProps,
      List partColNames, boolean ifNotExists,
      boolean orReplace, boolean isAlterViewAs) {
    this.viewName = viewName;
    this.schema = schema;
    this.comment = comment;
    this.tblProps = tblProps;
    this.partColNames = partColNames;
    this.ifNotExists = ifNotExists;
    this.orReplace = orReplace;
    this.isAlterViewAs = isAlterViewAs;
  }

  @Explain(displayName = "name")
  public String getViewName() {
    return viewName;
  }

  public void setViewName(String viewName) {
    this.viewName = viewName;
  }

  @Explain(displayName = "original text")
  public String getViewOriginalText() {
    return originalText;
  }

  public void setViewOriginalText(String originalText) {
    this.originalText = originalText;
  }

  @Explain(displayName = "expanded text")
  public String getViewExpandedText() {
    return expandedText;
  }

  public void setViewExpandedText(String expandedText) {
    this.expandedText = expandedText;
  }

  @Explain(displayName = "columns")
  public List getSchemaString() {
    return Utilities.getFieldSchemaString(schema);
  }

  public List getSchema() {
    return schema;
  }

  public void setSchema(List schema) {
    this.schema = schema;
  }

  @Explain(displayName = "partition columns")
  public List getPartColsString() {
    return Utilities.getFieldSchemaString(partCols);
  }

  public List getPartCols() {
    return partCols;
  }

  public void setPartCols(List partCols) {
    this.partCols = partCols;
  }

  public List getPartColNames() {
    return partColNames;
  }

  public void setPartColNames(List partColNames) {
    this.partColNames = partColNames;
  }

  @Explain(displayName = "comment")
  public String getComment() {
    return comment;
  }

  public void setComment(String comment) {
    this.comment = comment;
  }

  public void setTblProps(Map tblProps) {
    this.tblProps = tblProps;
  }

  @Explain(displayName = "table properties")
  public Map getTblProps() {
    return tblProps;
  }

  @Explain(displayName = "if not exists", displayOnlyOnTrue = true)
  public boolean getIfNotExists() {
    return ifNotExists;
  }

  public void setIfNotExists(boolean ifNotExists) {
    this.ifNotExists = ifNotExists;
  }

  @Explain(displayName = "or replace")
  public boolean getOrReplace() {
    return orReplace;
  }

  public void setOrReplace(boolean orReplace) {
    this.orReplace = orReplace;
  }

  @Explain(displayName = "is alter view as select", displayOnlyOnTrue = true)
  public boolean getIsAlterViewAs() {
    return isAlterViewAs;
  }

  public void setIsAlterViewAs(boolean isAlterViewAs) {
    this.isAlterViewAs = isAlterViewAs;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy