<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 第1關:統計每個城市的賓館平均價格 ``` /********** Begin *********/ //1.獲取城市id String cityId = Bytes.toString(result.getValue("cityInfo".getBytes(), "cityId".getBytes())); byte[] value = result.getValue(family, column); //獲取酒店價格 //String cityId1 = Bytes.toString(result.getValue("hotel_info".getBytes(), "price".getBytes())); //將價格轉換為double Double ho =Double.parseDouble(Bytes.toString(value)); //將價格轉換成()類型 DoubleWritable i = new DoubleWritable(ho); String key = cityId; //寫出(城市id,酒店價格) context.write(new Text(key),i); /********** End *********/ ``` ``` /********** Begin *********/ double sum=0; int count=0; for(DoubleWritable value:values){ count++; sum+=value.get(); } double avePrice=sum/count; //創建pit對象 Put put =new Put(Bytes.toBytes(key.toString())); put.addColumn("average_infos".getBytes(),"price".getBytes(),Bytes.toBytes(String.valueOf(avePrice))); context.write(null,put); /********** End *********/ ``` ### 第2關:統計酒店評論中詞頻較高的詞 ``` /********** Begin *********/ byte[] value = result.getValue(family, column); String word = new String(value,"utf-8"); if(!word.isEmpty()){ String filter = EmojiParser.removeAllEmojis(word); List<Word> segs = WordSegmenter.seg(filter); for(Word cont : segs) { Text text = new Text(cont.getText()); IntWritable v = new IntWritable(1); context.write(text,v); } } /********** End *********/ ``` ``` /********** Begin *********/ int sum = 0; for (IntWritable value : values) { sum += value.get(); } Put put = new Put(Bytes.toBytes(key.toString())); put.addColumn(family,column,Bytes.toBytes(sum)); context.write(null,put); /********** End *********/ ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看