1)Konjaku Monogatari-shu - “How Prince Kaya Made a Doll and Set It Up in the Rice Fields,” Chapter 24, Second tale

“At a time now past, there was a man named Prince KAYA (794-871 CE) who was a son of Emperor KANMU (781-806 CE). He was an extraordinarily skilled craftsman. There was a temple call Kyogokuji, which the Prince had established. It derived its income from the rice fields before it. These lay along the banks of the Kamo River.
One year there was a drought throughout the kingdom, and everywhere there were loud complaints of rice fields seared and dead. The temple's fields were in especial danger, for it was water from the Kamo River that irrigated them, and that river had dried up entirely. Soon the rice fields would become as barren ground, and the seedlings would redden and die.
Prince KAYA, however, contrived as follows. He made a doll in the shape of a boy about four feet tall, holding a jug upraised in both hands. It was devised so that when it was filled with water the water would instantly pour down over the boy's face. Those who saw it brought ladles full of water so that they could fill the jug and watch the boy's face get wet. It was a great curiosity; the news spread, and soon all the capital was there, pouring water and loudly enjoying the fun. And all the while, naturally, the water was collecting in the fields. When the fields were fully inundated, the Prince took the doll and hid it. And when the water dried up, he took the doll out and set it up again. Just as before, people gathered to pour water, and the fields were inundated. In this manner the fields were kept safe from harm.
This was a splendid device, and the Prince was praised to the skies for his ingenuity and skill. So the tale's been told, and so it's been handed down.” (from Ury, M. 1979. Tales of Times Now Past: Sixty-two Stories from a Medieval Japanese Collection, pp. 142-143)

2)Konjaku Monogatari-shu - “Kudara no Kahanari

Translator’s note – as the only available version of this anecdote was provided in classical Japanese, translation of the passage was unfortunately beyond my abilities!