Esempio n. 1
0
        public void DoesNotAddDefineIfJobNameAbsent()
        {
            var hiveJob = new HiveJobCreateParameters()
            {
                Query = "show tables"
            };

            var payloadConverter = new PayloadConverterBase();
            var payload          = payloadConverter.SerializeHiveRequest("hadoop", hiveJob);

            Assert.IsFalse(payload.Contains(Uri.EscapeDataString(string.Format("{0}={1}", WebHCatConstants.DefineJobName, hiveJob.JobName))));
        }
Esempio n. 2
0
        public void CanSerializeValidHiveJobRequest_WithFile()
        {
            var hiveJob = new HiveJobCreateParameters()
            {
                File = Constants.WabsProtocolSchemeName + "filepath.hql"
            };

            var payloadConverter = new PayloadConverterBase();
            var payload          = payloadConverter.SerializeHiveRequest("hadoop", hiveJob);

            Assert.IsTrue(payload.Contains(string.Format("{0}={1}", WebHCatConstants.File, Uri.EscapeDataString(hiveJob.File))));
        }
Esempio n. 3
0
        public void PayloadHasEnableLogsFalse()
        {
            var hiveJob = new HiveJobCreateParameters()
            {
                Query = "show tables"
            };

            var payloadConverter = new PayloadConverterBase();
            var payload          = payloadConverter.SerializeHiveRequest("hadoop", hiveJob);

            Assert.IsTrue(payload.Contains(string.Format("{0}={1}", HadoopRemoteRestConstants.EnableLogging, "false")));
        }
Esempio n. 4
0
        public void CanSerializeValidHiveJobRequest()
        {
            var hiveJob = new HiveJobCreateParameters()
            {
                Query = "show tables"
            };

            var payloadConverter = new PayloadConverterBase();
            var payload          = payloadConverter.SerializeHiveRequest("hadoop", hiveJob);

            Assert.IsTrue(payload.Contains(string.Format("{0}={1}", WebHCatConstants.Execute, Uri.EscapeDataString(hiveJob.Query))));
        }
Esempio n. 5
0
        public void JobCanSetEnableLogsTrue()
        {
            var hiveJob = new HiveJobCreateParameters()
            {
                Query          = "show tables",
                EnableTaskLogs = true,
                StatusFolder   = "/showtableslocation"
            };

            var payloadConverter = new PayloadConverterBase();
            var payload          = payloadConverter.SerializeHiveRequest("hadoop", hiveJob);

            Assert.IsTrue(payload.Contains(string.Format("{0}={1}", HadoopRemoteRestConstants.EnableLogging, "true")));
        }