为什么我得到"分区值:[空行]"读取文件时记录消息?

时间:2017-11-29 00:00:25

标签: apache-spark apache-spark-sql

我使用Spark SQL读取csv,我也收到很多这样的消息:

/* ---------- The EgComponent class ---------- */
;(function () {
  /* Create a new object from the prototype of HTMLInputElement. */
  var inputProto = Object.create(HTMLInputElement.prototype);

  /* Define some basic methods for the prototype of the component */
  Object.defineProperties(inputProto, {
    /* The function that clears a component instance. */
    onClear: {
      value: function() {
        this.value = "";
        this.style.position = "static";
        this.placeholder = "New Text";
      }
    },

    /* The function that sets the position of a component instance. */
    setPos: {
      value: function(x, y) {
        this.style.top = x + "px";
        this.style.left = y + "px";
        this.style.position = "relative";
      }
    },

    /* The function that sets the dimensions of a component instance. */
    setDimensions: {
      value: function(width, height) {
        this.style.width = width + "px";
        this.style.height = height + "px";
      }
    },

    /* The function that returns if the value of a component instance is uppercase. */
    caps: {
      value: function(input) {
        alert(/[A-Z]/.test(this.value) ? "Valid" : "Not Valid");
      }
    },

    /* The function that returns if the value of a component instance is lowercase. */
    lowerCaps: {
      value: function(input) {
        alert(/[a-z]/.test(this.value) ? "Valid" : "Not Valid");
      }
    },
  });

  /* Register the EgComponent in the browser. */
  window.EgComponent = document.registerElement("eg-input", {
    prototype: inputProto,
    extends: "input"
  });
})();



/* ---------- Instantiating an EgComponent ---------- */

/* Create a new instance of EgComponent. */
var egcomp = new EgComponent();

/* Set the 'placeholder' property. */
egcomp.placeholder = 20;

/* Set the 'pattern' property. */
egcomp.pattern = /[a-z]/;

/* Insert the component into the body of the document. */
document.body.appendChild(egcomp);

/* Log the component to the console. */
console.log(egcomp);

为什么说这是空行?分区真的是空的吗?

1 个答案:

答案 0 :(得分:6)

文件和从文件读取数据的Spark分区都不为空。

由于两件事,日志消息可能会有些混乱:

在您的情况下,目录结构是平坦的或不包含分区名称(例如/path/to/partition/1/hello/3.14),因此没有Hive样式的分区,因此您在消息中看到[empty row]