Edit

Share via


Invoke-AzureHDInsightHiveJob

Submits Hive queries to an HDInsight cluster, shows progress of the query execution, and gets query results in one operation.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Default (Default)

Invoke-AzureHDInsightHiveJob
    [-Arguments <String[]>]
    [-Defines <Hashtable>]
    [-File <String>]
    [-Files <String[]>]
    [-JobName <String>]
    [-Query <String>]
    [-RunAsFileJob]
    [-StatusFolder <String>]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

Description

This version of Azure PowerShell HDInsight is deprecated. These cmdlets will be removed by January 1, 2017. Please use the newer version of Azure PowerShell HDInsight.

For information about how to use the new HDInsight to create a cluster, see Create Linux-based clusters in HDInsight using Azure PowerShell. For information about how to submit jobs by using Azure PowerShell and other approaches, see Submit Hadoop jobs in HDInsight. For reference information about Azure PowerShell HDInsight, see Azure HDInsight Cmdlets.

The Invoke-AzureHDInsightHiveJob cmdlet submits Hive queries to an HDInsight cluster, displays the progress of the query execution, and gets the query results in one operation. You must run the Use-AzureHDInsightCluster cmdlet before running Invoke-AzureHDInsightHiveJob to specify the HDInsight cluster to which to submit a query.

Examples

Example 1: Submit a Hive query

PS C:\>Use-AzureHDInsightCluster "Cluster01" -Subscription (Get-AzureSubscription -Current).SubscriptionId
PS C:\> Invoke-AzureHDInsightHiveJob "select * from hivesampletable limit 10"

The first command uses the Use-AzureHDInsightCluster cmdlet to specify a cluster in the current subscription to use for a Hive query.

The second command uses the Invoke-AzureHDInsightHiveJob cmdlet to submit the Hive query.

Parameters

-Arguments

Specifies an array of arguments for a Hadoop job. The arguments are passed as command-line arguments to each task.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Defines

Specifies Hadoop configuration values to set when a job runs.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Params

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-File

Specifies the Windows Azure Storage Blob (WASB) path to a file in Azure blob storage that contains the query to run. You can use this parameter instead of the Query parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:QueryFile

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Files

Specifies a collection of files that are required for a Hive job.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobName

Specifies the name of a Hive job. If you do not specify this parameter, this cmdlet uses the default value: "Hive: <first 100 characters of Query>".

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Query

Specifies a Hive query.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:QueryText

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsFileJob

Indicates that this cmdlet creates a file in the default Azure storage account in which to store a query. This cmdlet submits the job that references this file as a script to run.

You can use this functionality to handle special characters such as percent sign (%) that would fail on a job submission through Templeton, because Templeton interprets a query with a percent sign as a URL parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StatusFolder

Specifies the location of the folder that contains standard outputs and error outputs for a job, including its exit code and task logs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.