查看执行时间 1 show profiles; 2 show variables;查看profiling 是否是on状态: 3 如果是off,则 set profiling = 1: 4 执行自己的sql语句: 5 show profiles:就可以查到sql语句的执行时间: 查看操作了多少行 在sql语句前面加上 explain就可以了: explain select * from event; +—-+————-+——-+——+—————+——+———+——+——+——-+ | id | s
背景 使用spark执行mapPartitionsWithIndex((index,iterator)=>{....}),在执行体中将iterator进行一次迭代后,再次根据iterator执行迭代,iterator迭代体未执行. 猜想及验证过程 猜测iterator只能执行一次迭代. 测试例子如下: val rdd1 = sc.makeRDD(1 to 10,2) val rdd2 = rdd1.mapPartitionsWithIndex{(index,iterator)=>{ var r
实例代码 while read line ; do ssh -p20002 $line -o StrictHostKeyChecking=no xxxxxxxxx done < ip.txt while 只循环一次原因: while 读取文本的第一行,然后执行循环,执行到ssh这部时,因为ssh会读取标准输入(stdin),把所有文本都读取了,因此while没有数据,便跳出循环. 解决方法: 在ssh中使用 -n 参数: -n Redirects stdin from /dev/null (ac
应用场景:例如选择一个单据号打击打印后先去数据库检索是否有打打印过,如果有则提示,已打印,是否再打 如果没有则不提示,直接进行打印. 实现原理:多做一个隐藏按钮去实现打印功能,页面上的打印按钮则进行数据库的后台操作,跟据取出的数据 可以在后台直接调用打印,或用脚本调用前台confirm 代码Demo: 后台: using System; using System.Collections.Generic; using System.Linq; using System.Web; using Sys