Wenn ich versuche, den Row-Schlüssel mit einer Spalte als Double in eine Hbase-Tabelle von Scala-Programm, I Ich sehe diese Art von 32-Bit-Darstellung in der Ausgabedatei (Hbase-Tabelle). Dies ist ein völliges Ende meiner Arbeit.Hbase-Tabelle mit Wert = x00 x00 x00 x00 x00 x00 x00 x00 aus dem Scala-Code
Bitte geben Sie an, wie wir die korrekte Darstellung für das Feld 'Double' in Hbase Table erhalten können.
Code für diese ist unten: Bin ich etwas hier fehlt?
VarValue_Output: Double
p(3).toDouble
final val colVarValueBytes = Bytes.toBytes("VarValue_Output")
put.add(cfDataBytes, colVarValueBytes, Bytes.toBytes(Data.VarValue_Output)
Dank Vijaya Kumar Pabothu
Bitte meinen Code unten sehen, bitte raten, wo ich bin doi falsch. –
def convertToPut (Sensor: Sensor): (ImmutableBytesWritable, Put) = { val Datums- und Uhrzeit = sensor.TimeStamp_Output val RowKey = sensor.ToolName_Output + "_" + Datums- und Uhrzeit val setzen = new Put (Bytes.toBytes (RowKey)) put.add (cfDataBytes, colLookupBytes, Bytes.toBytes (sensor.Lookup)) \t put.add (cfDataBytes, colVarNameBytes, Bytes.toBytes (sensor.VarName_Output)) put.add (cfDataBytes, colVarValueBytes, Bytes.toBytes (sensor.VarValue_Output)) return (neue ImmutableBytesWritable (Bytes.toBytes (RowKey)), put) } –
Definition - final val colVarValueBytes = Bytes.toBytes ("VarValue_Output") –